Is there a similar function like string::append in cstring lib???? for c-style strings (char*) ???
Printable View
Is there a similar function like string::append in cstring lib???? for c-style strings (char*) ???
strcat() and strncat(). Google them. They should be in string.h
k ty
any function which converts an integer into string ???
i know of itoa() but its non-standard any other????? trick ?? way ??? help or hint plzzz
sprintf()?
--
Mats
You could add '0' to each number and convert it to a string.
You could use a string stream
Note using stringstreams, you can convert strings to numbers, numbers to strings, or anything to anything that streams have operator<< and operator>> for.Code:#include <sstream>
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
char myString[] = "342";
stringstream s;
int a;
s << myString;
s >> a;
cout << a << endl;
}