null assingment

Asked by JungleRat on 2007-11-04

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

English Edit question
Ubuntu kdevelop Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
JungleRat (yossiturgeman) said : #1

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

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.

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

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?

JungleRat (yossiturgeman) said : #5

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

JungleRat (yossiturgeman) said : #6

Thanks sandi, that solved my question.