I am declaring a structure as this [CODE]typedef struct Request { deque<int> roomsList ; }Request;[/CODE] Then , in some other function I get a segmentation fault in the highlighted line : [CODE] int initRoomsList(Request *R) { int roomSatisfying ; char roomName[20] ; int roomNum, capacity,wb,proj, lcd, sound, aud, vid , ac ; int count = 0; FILE *fp ; fp = fopen("rooms.txt","r") ; while(fscanf(fp,"%d %d %d %d %d %d %d %d %d %s", \ &roomNum,&capacity, &wb,&proj,&lcd,&sound,&aud,&vid,&ac,roomName) != EOF ) { if(R->capacity > capacity ) continue ; if(R->wb > wb ) continue ; if(R->proj > proj) continue ; if(R->lcd > lcd …

Member Avatar
Member Avatar
+0 forum 5

The End.