![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 1
Rep Power: 0
![]() |
about write bytes to a file
i try to read a.wav and create the same file as receive.wav
but receive.wav is not the same as a.wave receive.wav is different after getting '00' in hexa format. what is the problem ? FILE *fp=fopen("a.wav","rb"); FILE *fp2 = fopen ("receive.wav" , "wb"); // obtain the file size fseek (fp , 0 , SEEK_END); lSize = ftell (fp); rewind(fp); // allocate memory to contain the whole file. buffer = (char*) malloc (lSize); if (buffer == NULL) return FALSE; // copy the file into the buffer. fread (buffer,1,lSize,fp); if(fp2 != NULL) { cout<<"size"<<fwrite (buffer , 1 , lSize , fp2)<<endl; fclose (fp2); } fclose (fp); |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|