//=====================Sending a File at Socket========================= FILE *fp = fopen("File.txt", "r+"); char file_buffer[1000]; fseek(fp, 0, SEEK_SET); int bytes_read=0; if((bytes_read=fread(file_buffer, 1, file_size, fp))<=0) { MessageBox( NULL, "Unable to copy file into buffer", "Error!", MB_ICONEXCLAMATION | MB_OK); exit(1); } MessageBox( NULL, file_buffer, "File copied in Buffer", MB_ICONEXCLAMATION | MB_OK);
file_size
fread
count
FILE *fp = fopen("File.txt", "r+b");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)