Click here to Skip to main content
15,895,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Rotated text using Drawtext Pin
Luc Pattyn11-Aug-10 8:48
sitebuilderLuc Pattyn11-Aug-10 8:48 
GeneralRe: Rotated text using Drawtext Pin
Maximilien11-Aug-10 9:00
Maximilien11-Aug-10 9:00 
GeneralRe: Rotated text using Drawtext Pin
CPallini11-Aug-10 22:20
mveCPallini11-Aug-10 22:20 
QuestionReading chunks of Data Pin
AbhiHcl11-Aug-10 3:05
AbhiHcl11-Aug-10 3:05 
AnswerRe: Reading chunks of Data Pin
CPallini11-Aug-10 3:27
mveCPallini11-Aug-10 3:27 
AnswerRe: Reading chunks of Data Pin
elchupathingy11-Aug-10 3:34
elchupathingy11-Aug-10 3:34 
GeneralRe: Reading chunks of Data Pin
AbhiHcl11-Aug-10 3:42
AbhiHcl11-Aug-10 3:42 
GeneralRe: Reading chunks of Data Pin
Cool_Dev11-Aug-10 4:47
Cool_Dev11-Aug-10 4:47 
this is how you may do it.
//string array to store comma seperated data
char buffer[100][10] = {0};
int i = 0;

char seps[] = "\r\n";
bool ok = false;

while(incoming data)
{
	//hard-coded - newly read data
	char data[] = "1,2,3\r\n1,3,4\r\n3,4,";

	//copy to temp
	char temp[100];
	strcpy(temp, data);

        //tokenize
	char *token = strtok( temp, seps );
	while( token != NULL )
	{
		if(! strcmp(token, "CMD OK"))//end?
		{
			ok = true;
			break;
		}
		strcat(buffer[i++], token);
		token = strtok( NULL, seps );
	}

	if(ok);
	    break;

	//last data complete?
	if( strcmp(&data[strlen(data)-2], "\r\n"))
	    --i;

}


hope strtok is known to you. never ask here for this kinda simple codes ever. you may not get it more Hmmm | :|
AnswerRe: Reading chunks of Data Pin
bleedingfingers11-Aug-10 7:59
bleedingfingers11-Aug-10 7:59 
Questionwrong output ,error in my program Pin
0x808511-Aug-10 3:03
0x808511-Aug-10 3:03 
AnswerRe: wrong output ,error in my program Pin
mk1488211-Aug-10 3:19
mk1488211-Aug-10 3:19 
GeneralRe: wrong output ,error in my program Pin
0x808511-Aug-10 3:30
0x808511-Aug-10 3:30 
AnswerRe: wrong output ,error in my program Pin
Maximilien11-Aug-10 3:26
Maximilien11-Aug-10 3:26 
GeneralRe: wrong output ,error in my program Pin
0x808511-Aug-10 3:41
0x808511-Aug-10 3:41 
GeneralRe: wrong output ,error in my program Pin
mk1488211-Aug-10 4:24
mk1488211-Aug-10 4:24 
GeneralRe: wrong output ,error in my program Pin
0x808511-Aug-10 4:30
0x808511-Aug-10 4:30 
AnswerRe: wrong output ,error in my program Pin
elchupathingy11-Aug-10 3:41
elchupathingy11-Aug-10 3:41 
QuestionProblem with String Array Pin
T.RATHA KRISHNAN11-Aug-10 0:21
T.RATHA KRISHNAN11-Aug-10 0:21 
AnswerRe: Problem with String Array Pin
CPallini11-Aug-10 0:36
mveCPallini11-Aug-10 0:36 
GeneralRe: Problem with String Array Pin
T.RATHA KRISHNAN11-Aug-10 0:46
T.RATHA KRISHNAN11-Aug-10 0:46 
GeneralRe: Problem with String Array Pin
CPallini11-Aug-10 1:18
mveCPallini11-Aug-10 1:18 
GeneralRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 0:54
Nuri Ismail11-Aug-10 0:54 
GeneralRe: Problem with String Array Pin
CPallini11-Aug-10 1:17
mveCPallini11-Aug-10 1:17 
GeneralRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 1:44
Nuri Ismail11-Aug-10 1:44 
AnswerRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 0:51
Nuri Ismail11-Aug-10 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.