int to string | developer.brewmp.com int to string | developer.brewmp.com

Developer

int to string

Forums:

Hi All,

How can i convert int to string or wide string????

i have to print score & i was anable to print it because it is in integer.....

it urgent plz help me anybody..

Regards

try the folowing code:
int a=5;
char *buf;
buf=(char*)MALLOC(sizeof(int));
SPRINTF(buf,"%i",a);
DBGPRINTF("my char is %s",buf);
hope this helps

try the folowing code:
int a=5;
char *buf;
buf=(char*)MALLOC(sizeof(int));
SPRINTF(buf,"%i",a);
DBGPRINTF("my char is %s",buf);
hope this helps

this works fine, but i want score in middle of the string like
"Good you done in 100 sec."
in one line only so how can i?

this works fine, but i want score in middle of the string like
"Good you done in 100 sec."
in one line only so how can i?

try this
int a=100;
char *buf;
buf=(char*)MALLOC(sizeof(int));
SPRINTF(buf,"Good you done in %i sec.",a);
DBGPRINTF("my char is %s",buf);

try this
int a=100;
char *buf;
buf=(char*)MALLOC(sizeof(int));
SPRINTF(buf,"Good you done in %i sec.",a);
DBGPRINTF("my char is %s",buf);

:)
thanks it works very fine
Regards

:)
thanks it works very fine
Regards

BREW SPRINTF pretty much works like standard CRT sprintf. Refer any good C/C++ book on CRT function usage.

BREW SPRINTF pretty much works like standard CRT sprintf. Refer any good C/C++ book on CRT function usage.

can you tell me what is CRT function from where can i get? plz

can you tell me what is CRT function from where can i get? plz

no

buf=(char*)MALLOC(sizeof(int));

yes

buf=(char*)MALLOC(sizeof(char) * MAX_TEXT_LENGTH );

no

buf=(char*)MALLOC(sizeof(int));

yes

buf=(char*)MALLOC(sizeof(char) * MAX_TEXT_LENGTH );