Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Strcmp() problem stepping through AVR Studio

2005-04-11 by wbounce

If have serveral strcmp statements

Originally I had them all like this.

if (strcmp("GPGGA",gcBuffer) == 0)
	{
	gpFieldPtr=(PGM_P) GGA;
	} 	

It would execute the pointer assignment on each of the 8 statements

I changed them to 

lnResult = strcmp("GPGLL",gcBuffer); 
if (lnResult == 0)
	{
	gpFieldPtr=GLL;
	}  

So I could see the result code of strcmp. This time it skipped the 1st 3
ok but then started doing the assignments. And when it got to the strcmp
that should have matched, lnResult was not 0 and yet it did the
assignment anyhow.

Anyone have any idea why?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.