whats this warning mean?and how to search keyword...
im running a prog.on linux c BUT keep on gettin warning msgs: Ansii c++ prohibits void* conversion
in the malloc part of the linked list.
ex.pNew = malloc(sizeof(structGNodeType));
im also tryin to make a code that given a keyword it will search for its instances in all the Questions(take note that words in the question are seperated by a space)-my code here runs but doesnt seem to get any match though im pretty sure the keyword i entered has a match.anybody help??
int find(ptrGNode pGame)
{ ptrGNode pTemp;
int nCtr,i,j,k,l,m,nVal;
str70 strTemp;
char sKey[31];
int nFound=0,nWhere;
nCtr =0;
do{printf("\n\n Enter Keyword:>");
scanf("%s",sKey);
if(strlen(sKey)>31)
printf("Keyword must only be 30 characters or less");
since your struct/class member pNew likely has a different type you have to explicitly typeconfvert.
Say pNew is a pooiinter to int write:
ex.pNew = (int*) malloc (...);
ive already tried fixin the errors ......already fixed but how come it generateda segmentation fault whats worng with my code or what might have possibly caused it?:confused:
segmentation fault seams to indicate that you're accessing data you shouldn't. This points to either pointers or indices.
In your 3.lvl while - loop
while(pTemp->sGame.strQuestions[i]!='\0')
you don't increment 'i' so you got an infinite loop. I don't really understand your code so i can't tell you what the correct version should look like.