Re: [Dev-C++] Can I create a string from a non-string #define value??
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Minds W. <min...@gm...> - 2005-12-16 14:28:40
|
Hi Mike, This would work if the #define was in the code. But my problem is that the the #define came from a command line, and i CANT put the "" on it. (As I said before, I cannot change the value format) I need something in the code the gets the #define value that is not a strin= g and make a string from it. I tried de # opertator #define to_string( x ) # x const char* VERSION =3D to_string( RELEASE_DATE ); but I get "RELEASE_DATE" and not "2005_11_11_-_11:11:11" PS: sorry for sending this to your personal email... (new mail program.....= ) On 12/16/05, mi...@ne... <mi...@ne...> wrote: > > How about trying > > #define RELEASE_DATE "2005_11_11_-_11:11:11" > > That makes the defined as a string. > > Mike, > www.nanobit.net > > > ----- Original Message ----- > *From:* Minds Work <min...@gm...> > *To:* dev...@li... > *Sent:* Friday, December 16, 2005 4:31 AM > *Subject:* [Dev-C++] Can I create a string from a non-string #define > value?? > > > Hi > > I have a #define like this: > > #define RELEASE_DATE 2005_11_11_-_11:11:11 > > And I cannot change the value format :( > > How can I create a string (char *) form the RELEASE_DATE define??? > > []s > > |