Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Kernoel

Why do i get an error with this?

This topic is 6066 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just figuered out one problem just to get the next one Here are two code snippets... why do i get an "warning C4129: ''c'' : unrecognized character escape sequence" warning???
  
#define FILE_NAME  "c:\cdc-saver\cdc.3ds"

g_Load3ds.Import3DS(&g_3DModel, FILE_NAME);
  
pls reply if you know! i need to get this finished TODAY.... Thx, Markus

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
#define FILE_NAME "c:\cdc-saver\cdc.3ds"g_Load3ds.Import3DS(&g_3DModel, FILE_NAME);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Use double \\ in a string literal

#define FILE_NAME "c:\\cdc-saver\\cdc.3ds"
g_Load3ds.Import3DS(&g_3DModel, FILE_NAME);

Share this post


Link to post
Share on other sites
  
#define FILE_NAME "c:\\cdc-saver\\cdc.3ds"
g_Load3ds.Import3DS(&g_3DModel, FILE_NAME);



"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try #define FILE_NAME "c:\\cdc-saver\\cdc.3ds"

The error is caused because in c, the ''\'' character means that the next character is part of an escape sequence, to let the programmer output or input things they normally couldn''t. For example, \" writes a ''"'' to the screen.

So when you have ''\c'' it thinks you are trying to do an escape sequence, but there isn''t one for ''\c''. Putting in ''\\'' works because that is the escape sequence for ''\''.

Share this post


Link to post
Share on other sites

you can also do this:

const char* FILENAME = "c:/cdc-saver/cdc.3ds";

totally unneccessary to use a #define for a string

Share this post


Link to post
Share on other sites
None of those sollutions work........ i tried...

i don''t understand this.... when i start the program the screen flickers, and it does nothing....

Share this post


Link to post
Share on other sites
To Lowas:

error C2664: ''Import3DS'' : cannot convert parameter 2 from ''const char *'' to ''char *''


????? i tried like you said.... ?????

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!