Access Violation under VC++ 6.0
got access violation running this code, and the IDE jumps into a bunch of assembly lines
Code:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
char dic[][40] = {
"atlas", "a volume of maps",
"car", "a mobilized vehicle",
"telephone", "a communication device",
"air plane", "a flying machine",
"", "" /* null terminates the string */
};
int main(void)
{
char **p;
char word[80], ch;
do
{
puts("\nEnter the word you wish to seach:");
scanf("%s",word);
p=(char**)dic;
do
{
if(!strcmp(*p,word)){
puts("\n the meaning is");
puts(*(p+1));
break;
}
if(!strcmp(*p,word)) break;
p=p+2;
} while (*p);
if(!*p)puts("continue? (Y/N)");
scanf("%c%*c",&ch);
}while(toupper(ch)!='N');
return 0;
}
and the two bold part seem redundant to me, please some one explain . I got this code from a C/C++ reference.