|
-
Jun 11th, 2004, 06:29 PM
#1
Null terminated string. [Resolved]
is this a perfectly null terminated string?
Code:
TCHAR* g_strFrameStats = _T("Hello\0");
Last edited by NoteMe; Jun 11th, 2004 at 06:48 PM.
-
Jun 11th, 2004, 06:48 PM
#2
Ohhh...yeah it was....sorry, but I found out that it was an other thing causing the error..
ØØ
-
Jun 12th, 2004, 12:21 PM
#3
I'm pretty sure that when you use a string literal like that, most compilers will add a null terminator for you.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
Jun 13th, 2004, 08:08 AM
#4
Originally posted by sunburnt
I'm pretty sure that when you use a string literal like that, most compilers will add a null terminator for you.
OK...I didn't know that. But I found a DX example that actualy used the same method as I did with the \0 at the end. So it is working now. But thanks anyway.
ØØ
-
Jun 13th, 2004, 10:52 AM
#5
All compilers add the \0, it's required. Why you have in your literal is a double-\0 terminated string. In some places in the API you need those.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 13th, 2004, 11:19 AM
#6
The doc said I only needed a null terminated string as a parameter. So I guess I don't need a double. I can test it out later on today. I am sitting onthe wrong PC at the moment. And we have to rewrite most of the code anyway, becuase we overlooked a one of D3D internaly critical sections. So we have to rearagne the work of the two threads.
But I will give you guys a comment on it when I have tested it.
ØØ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|