Thread: char *
View Single Post
Old Feb 23rd, 2006, 10:32 PM   #2
myName
Programmer
 
Join Date: Oct 2005
Posts: 48
Rep Power: 0 myName is on a distinguished road
i try this

	
             string strMsg = chMsg;
	string strOne = strMsg.substr(0,1);
	string strTwo = strMsg.substr(1,4);
	string strThree = strMsg.substr(5,3);
	string strFour =strMsg.substr(8,2);

	printf( "chMsg: %s \n", strMsg);

error in printf, the use of %s.
i found that %s is just use for char *.
How bout string data type?
myName is offline   Reply With Quote