A pointer-string question
Hello everyone ,
I ' d like to ask a little question which still confuses me sometimes. :
-------
char *ptr;
fgets(ptr,10,stdin);
When I compile these codes my compiler ( Pellec C) will give an error which tells me that I have never assigned a value to ptr.
I cant tell that is not right if I think that ptr is a pointer. It needs an adress of a string maybe or another char variable. But I heard that some compilers dont give this error. Is this really depending on my compiler? I am going mad becasue of this question everytime I sit in front of my computer. Yes I can use the features of c easily and I make sense with them. But I need to understand everything trully complete to feel comfortable when using them. If you helped , I would be glad..