#include<stdio.h>
main(){
int i=0;
char *keyword[]={
"auto",
"break",
"case",
"char",
"const",
"continue",
"default",
"do",
"double",
"else",
"enum",
"extern",
"float",
"for",
"goto",
"if",
"int",
"long",
"register",
"return",
"short",
"signed",
"sizeof",
"static",
"struct",
"switch",
"typedef",
"union",
"unsigned",
"void",
"volatile",
"while"};
do{
printf("%s\n",keyword[i]);
++i;
} while((keyword[i])!='\0');
printf("%d",i);
}
while executing this program i get segmentation fault after while is printed. the value of i doesn't get printed.what should i do to make this code run successfully?
is this code correct?


Sign In
Create Account


Back to top









