A
Andrej Viktorovich
Hello,
Moving from delphi to C
Got garbage on output while converting integer to C string. Have feeling that something wrong with char* on intToStr return. What is the right way of doing that?
char* intToStr(int value)
{
char buffer[33];
char* c;
c= itoa(value,buffer,10);
return buffer;
}
int _tmain(int argc, _TCHAR* argv[])
{
cout<<intToStr(55)<<"\n";
getc(stdin);
return 0;
}
Thank you
Moving from delphi to C
Got garbage on output while converting integer to C string. Have feeling that something wrong with char* on intToStr return. What is the right way of doing that?
char* intToStr(int value)
{
char buffer[33];
char* c;
c= itoa(value,buffer,10);
return buffer;
}
int _tmain(int argc, _TCHAR* argv[])
{
cout<<intToStr(55)<<"\n";
getc(stdin);
return 0;
}
Thank you