I'm having problems getting an equality with strcmp. Here is my code:
Ive got my debug code set up there, and when I run the files the sample output shows a match, but it continues through the loop until the program crashes. Here is the output:Code:char myframe[frameheight][framewidth]; patch pptr; patch *p; p = &pptr; command cptr; command *c; c = &cptr; //system("PAUSE"); int i; for(i = 0; i < sizeof(commandstructures); ++i){ //get command and first patch c = &commandstructures[i]; p = &patchstructures[0]; int count = 0; //match patch name while(strcmp(c->patchname, p->name) != 0){ printf("%s %s",c->patchname, p->name); count++; p = &patchstructures[count]; } //put the patch on the frame in the correct location int x, y; for(x = 0; x < p->height; ++x){ for(y = 0; y < p->width; ++y){ myframe[c->xcoor][c->ycoor] = p->patch[x][y]; } } }
Got me all shook up. I'm tired and I want to get this done. Ha...Code:File List: patches1.txt patches2.txt patches3.txt commands1.txt commands2.txt commands3.txt Input a patches filename: patches1.txt Input a commands filename: commands1.txt rect rect rect ex rect dollar rect rect rect rect rect rect rect rect rect EL32.dllrect