null assingment

Asked by JungleRat

hi everybody i got a question i need to check if the next cell in a list is null
here is the problematic line (sp is a pointer to a struct) :

while(getNext(sp) != Null);
 {
  printf("%s, %ld, %f\n" ,getName(sp), getID(sp), getGrade(sp));
 }

and the kdevelop compiler say the following:

compiling studentlist.c (gcc)
/home/yossi/c_ex_1/src/studentlist.c:32: error: ‘Null’ undeclared (first use in this function)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu kdevelop Edit question
Assignee:
No assignee Edit question
Solved by:
sandic
Solved:
Last query:
Last reply:
Revision history for this message
JungleRat (yossiturgeman) said :
#1

i have tried NULL,Null,null and nothing helps my fellow classmates have the same problem
PLease help :)

Revision history for this message
Best sandic (sandipan) said :
#2

NULL is defined in stddef.h so you need to include stdio.h
If that doesn't help use (void*)0 instead of Null,both mean the same.

Revision history for this message
JungleRat (yossiturgeman) said :
#3

thank you this is working great
i think i still have got a component missing because in the line printf(" ")
i cant make the char " i can only make the char ¨ which is diffrent and does not compile (it does not turn red)
do you know what am I missing? (its a pain to copy th " from places to places)
thanks again

Revision history for this message
Clóvis Fabrício (nosklo) said :
#4

You must be having some keyboard configuration issue. What language is your keyboard? Have you tried messing with System -> Preferences -> Keyboard Layout configuration?

Revision history for this message
JungleRat (yossiturgeman) said :
#5

yes i have tried to. nothing wors can you be more specific please?

Revision history for this message
JungleRat (yossiturgeman) said :
#6

Thanks sandi, that solved my question.