Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 If the following structure is written to a file using fwrite(), can fread() read it back successfully? struct emp { char n; int age; }; struct emp e={"IndiaBIX", 15}; FILE fp; fwrite(&e, sizeof(e), 1, fp); ?->(Show Answer!)
1. If the following structure is written to a file using fwrite(), can fread() read it back successfully? struct emp { char n; int age; }; struct emp e={"IndiaBIX", 15}; FILE fp; fwrite(&e, sizeof(e), 1, fp);
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
Since the structure contain a char pointer while writing the structure to the disk using fwrite() only the value stored in pointer n will get written. so fread() fails to read.