« first day (628 days earlier)      last day (1800 days later) » 

12:12 PM
Fill the Heart with the oil of love.
Place in it the wick of single-pointed mind.
Light it with the Knowledge of Truth and remove
the darkness of ignorance around you.
Just as one lamp can light many lamps; let each
youth kindle this Light in many hearts.
May the light that we celebrate at Diwali show us the way and lead us
together on the path of peace and social harmony "WISH U A VERY HAPPY
DIWALI"
 
1 message moved from Lounge<C++>
 
 
7 hours later…
7:18 PM
can i ask a question on c?
i know the meaning of the arguments in fread(&emp,sizeof(emp),1,fp)
&emp->address of the structure
sizeof(emp)-> gives the no of bytes occupied by the structure
1->no of structures we need to read at a time
fp is the file pointer
but i don't understand how does it work in a while loop... how does it increment itself
while(fread(&emp,sizeof(emp),1,fp)==1)
{
printf("%d%d",emp.id,emp.age);
printf("\n");
}
 
1 message moved from Lounge<C++>
 
how does it increment to produce different values from the file
i know the meaning of the arguments in fread(&emp,sizeof(emp),1,fp)
but i don't understand how does it work in while loop
for example lets say:
while(fread(&emp,sizeof(emp),1,fp)==1)
{
printf("%d %d",emp.id,emp.name);
printf("\n");
}
how does the pointer increment to procude the o/p like
1 19
2 30
3 40
 
3 messages moved from Lounge<C++>
 

« first day (628 days earlier)      last day (1800 days later) »