Whenever i try to read the char from file and try to access it i am getting error . My code is :
while((c=fgetc(f))!=EOF) {
if(c == '\n') {
str[i]='\0';
Info* inf = new Info();
inf->getInputFromFile(str);
if((table->insert(inf))==0)
cout<<"exist."<<endl;
//delete inf;
for(int j =0; j<50;j++)
str[j]='\0';
i=0;
} else {
str[i] = c;
i++;
}
But here when ever I try to give a dummy word such as : inf->getInputFromFile("Hello");
I am not getting any error. I can't also find the error using debuggin because when I press F8(CodeBlocks IDE) my debugger start and it doesn't stop any line. i.e. i don't find any error when running the program using F8.
Here is the input file content :
int, INTEGER
myFunction, FUNCTION
x, IDENTIFIER
5, NUMBER
x, Identity
char, CHARACTER
fl, FLOAT
dbl, DOUBLE
you, MEINTHIS
dlt, DELETE
hel, HELLOWORLD
string, STRING