This question may look stupid but that's how people learn :).I learned C++ where you didn't have to worry about referencing int variable in cin>> . Today I was learning filehandling in C for school work but When I tried to run the program with this syntax, I got error.
scanf("%d\n %s\n",id, name);
But when I referenced id in scanf, the error was gone.i-e;
scanf("%d\n %s\n",&id, name);
Why is this so? I will be very thankful for answering this noob question..