How do I convert an integer variable to a char that can be displayed onto the screen? For example, this is the code I'm using, but it won't write out the value of the integer:
int anynum = 0;
char mymessage[30]={0};
strcpy(mymessage,"My number is: ");
strcat(mymessage,anynum);
cout << mymessage;
The error occurs at the strcat function, because anynum is the wrong datatype. How do I convert it?
Thanks...
int anynum = 0;
char mymessage[30]={0};
strcpy(mymessage,"My number is: ");
strcat(mymessage,anynum);
cout << mymessage;
The error occurs at the strcat function, because anynum is the wrong datatype. How do I convert it?
Thanks...