%d is a format specifier for interger.
& indicates address of variable i.e pass by value
User Profile
Collapse
-
can any one explain when do we use fwrite and when do we use fprintf while storing the data into file...
thanks in advanceLeave a comment:
-
srinivas reddy replied to hello guys i am new in coding, i want to learn c++ so i started a simple and my firstin Cif you want to learn c++, better learn c first then later c++ easy for freshers. the above code has two mistakes one is you are writing void main() it means nothing to return(just keep return;) if your want use int main() it will return value(i.e return 0; or return (expression)),a nd another is scanf("%d%d\n", &a,&b); \n is used for new line so in scanf it is not necessary ,it is used in printf for cursor into new line.Leave a comment:
-
I have a small doubt on fprintf and fwrite.
The above code is working fine,first am entering the three students data after am closing my console,again am open my console entered again three students data , if am reading all students data am got just last entered few students data,why this occurs???????
and
is there any possibilities to use fwrite instaed of fprintf to store the data into file.
Code:#include<stdio.h> #include<string.h> #include<time.h>
No activity results to display
Show More
Leave a comment: