Friday, July 31, 2009

What is the difference btw decleration and definition in c language?

please explain wid the help of memory mapping

What is the difference btw decleration and definition in c language?
Declaration is where a function signature is defined.


Definition is the point where you have the actual function.





ex.


int myfunc(int id, char * name); /* this is declaration */





int main()


{


/* call my func */


int x = myfunc(1, "hello");


}





/* this is definition */


int myfunc(int id, char * name)


{


printf( "%d : %s\n", id, name);


}


No comments:

Post a Comment