Click here to Skip to main content
15,846,899 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Winsock 2 question Pin
led mike2-Jun-06 12:15
led mike2-Jun-06 12:15 
QuestionHANDLE - what exactly is it ? Pin
big_denny_2002-Jun-06 11:16
big_denny_2002-Jun-06 11:16 
AnswerRe: HANDLE - what exactly is it ? [modified] Pin
Maxwell Chen2-Jun-06 11:57
Maxwell Chen2-Jun-06 11:57 
QuestionHow to learn develop in C++ and VOIP ? Pin
Yanshof2-Jun-06 9:47
Yanshof2-Jun-06 9:47 
AnswerRe: How to learn develop in C++ and VOIP ? Pin
led mike2-Jun-06 9:55
led mike2-Jun-06 9:55 
GeneralRe: How to learn develop in C++ and VOIP ? [modified] Pin
Yanshof2-Jun-06 11:39
Yanshof2-Jun-06 11:39 
AnswerRe: How to learn develop in C++ and VOIP ? [modified] Pin
Maxwell Chen2-Jun-06 12:04
Maxwell Chen2-Jun-06 12:04 
Questionstring issues again [modified] Pin
big_denny_2002-Jun-06 9:21
big_denny_2002-Jun-06 9:21 
Hello again Smile | :)

Please someone explain me next situation

I have next code :

...
      const UINT SIZE = 5;

	TCHAR strDest[SIZE];

	LPCTSTR strSource = _T("cool");

	_tcscpy_s(strDest,sizeof(strDest)/sizeof(TCHAR), strSource);
	
	CString s(strDest);

	MessageBox(s);
...


Everything works fine, but I get some differences in Debug and Release builds.

Specifficaly, in Release build, in debugger when I look at contents of strDest after _tcscpy_sfunction, I see that, first 4 bytes of it are occupied by come strange characters and 5th byte is 'c', but anyway the resule is displayed correctly in Message box.

In Debug build everything happens as expected : first 4 bytes are occupied by 'c' 'o' 'o' 'l' and 5th byte is '\0'

Why is this difference ?

thank you.

I have VS2005

-- modified at 14:21 Friday 2nd June, 2006
AnswerRe: string issues again [modified] Pin
Zac Howland2-Jun-06 9:30
Zac Howland2-Jun-06 9:30 
AnswerRe: string issues again Pin
Anton Mikhalyov2-Jun-06 22:38
Anton Mikhalyov2-Jun-06 22:38 
QuestionDriver creation problem Pin
Sharath862-Jun-06 8:34
Sharath862-Jun-06 8:34 
AnswerRe: Driver creation problem Pin
Maxwell Chen2-Jun-06 12:28
Maxwell Chen2-Jun-06 12:28 
QuestionBinary Trees Pin
Mridang Agarwalla2-Jun-06 8:30
Mridang Agarwalla2-Jun-06 8:30 
AnswerRe: Binary Trees Pin
Zac Howland2-Jun-06 10:07
Zac Howland2-Jun-06 10:07 
AnswerRe: Binary Trees Pin
David Crow2-Jun-06 10:43
David Crow2-Jun-06 10:43 
Questionmanaged String in Visual C++ / call a function like void f(int& x, String* s) Pin
karlheinzsteinhart2-Jun-06 7:05
karlheinzsteinhart2-Jun-06 7:05 
AnswerRe: managed String in Visual C++ / call a function like void f(int& x, String* s) Pin
Chris Losinger2-Jun-06 8:05
professionalChris Losinger2-Jun-06 8:05 
Questionwcscpy_s issues [modified] Pin
big_denny_2002-Jun-06 6:13
big_denny_2002-Jun-06 6:13 
AnswerRe: wcscpy_s issues [modified] Pin
Nish Nishant2-Jun-06 6:22
sitebuilderNish Nishant2-Jun-06 6:22 
QuestionRe: wcscpy_s issues [modified] Pin
David Crow2-Jun-06 6:33
David Crow2-Jun-06 6:33 
AnswerRe: wcscpy_s issues [modified] Pin
Viorel.2-Jun-06 6:33
Viorel.2-Jun-06 6:33 
AnswerRe: wcscpy_s issues [modified] Pin
Zac Howland2-Jun-06 6:36
Zac Howland2-Jun-06 6:36 
GeneralRe: wcscpy_s issues [modified] Pin
Viorel.2-Jun-06 6:42
Viorel.2-Jun-06 6:42 
GeneralRe: wcscpy_s issues [modified] Pin
big_denny_2002-Jun-06 7:03
big_denny_2002-Jun-06 7:03 
GeneralRe: wcscpy_s issues [modified] Pin
Zac Howland2-Jun-06 7:02
Zac Howland2-Jun-06 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.