Hi!
It is my first post here, so don't tread on me :)! I want to ask, how to watch result of function?
I don't know what to do with this - I tried "Watch 1", but I can't get satisfied result - I mean see "EQUAL" or "DIFFERENT".
I attached my code here:
#include <LPC21xx.H> #include <string.h> #define NULL 0 enum CompResult{DIFFERENT, EQUAL}; enum CompResult eCompareString(char pcStr1[], char pcStr2[]){ unsigned char ucCounter; for(ucCounter=0; pcStr1[ucCounter]==pcStr2[ucCounter]; ucCounter++){ if(pcStr1[ucCounter]==NULL){ return EQUAL; } } return DIFFERENT; } int main(){ char pcStr1[] = {'a','b','c', NULL}; char pcStr2[] = {'d','e','f', NULL}; enum CompResult{DIFFERENT, EQUAL}; eCompareString(pcStr1, pcStr2); return 0; }
Thank's for help and have a good night ;)!