by vector do you mean a character array ? Such as char data[255];
Use the FILE and associated functions located in stdio.h to read and write files. Here is a tutorial.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
since its binary data it will be better to read it into unsigned char array. There is one way to do it.
unsigned char* buf = 0;
size_t filesize = 0;
FILE* fp = fopen("sound.mp3","rb");
// get the size of the file and allocate input buffer space
fseek(fp,0,SEEK_END);
filesize = ftell(fp);
// go back to beginning of file
fseek(fp,0,SEEK_SET);
// allocate input buffer
buf = malloc(filesize);
// read into buffer
fread(buf,1,filesize,fp);
fclose(fp);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343