Hi
I saved data ( with specific size and address) in main memory of PC (i.e CPU memory)... How can I copy it in the PC hard dick such as D drive using C programming?
Thanks
Hussam
Hi
I saved data ( with specific size and address) in main memory of PC (i.e CPU memory)... How can I copy it in the PC hard dick such as D drive using C programming?
Thanks
Hussam
Open the file with fopen. Write the data to file using fwrite. Close the file with fclose. Be sure to check your return values. Make sense?
"hard dick" hahahaah
Anyway, that sounds pretty easy
Code:FILE f = fopen("mydata.bin","wb"); char *ptr; ptr = 0x12345678; // some address in memory fwrite(ptr, sizeofthatdatahere, 1, f); fclose(f); ptr = NULL;
Yes, this was just a quick example, I was just outlining the process. I would regularly check to see if fopen returns NULL or if the fwrite failed. Points 1 and 4 are basically the same.