Hi and thank for any help in this issues.
I have a program who declare the following variables
I then initiate the array of reswrd[0] with the following wayCode:#define idbuffsize 256 #define nreswrd 59 char idbuff[idbuffsize]; char* reswrd[59];
I also used idbuff as a way to store every single character that i am reading such as idbuff[k] = ch; where ch is a character at a time.Code:reswrd[ 0] = "ARRAY"; reswrd[ 1] = "BEGIN"; reswrd[ 2] = "BY"; reswrd[ 3] = "CASE";
At the end I want to compare both string idbuff to my list of array of reswrd allowing me to see if yes or not in the list
Now the following code does work
where reswrd[1] would work and compare the string but that not what i want it to achieve. I want to do the following.Code:printf("%s", idbuff); char* foo; foo = idbuff; char* bar; bar = reswrd[1]; if( cmpstr(foo, bar) == 0)...
int i;
and would like to go through the list of reswrd at i items and just do a loop or something to allow me to read it. However when running my program it freeze, i am wondering if i am miss something in c string structure or with pointer. Thanks in advance



LinkBack URL
About LinkBacks


