Upload pics to a server using c++ -


i'm trying upload photo 1 of our server in c++, following excerpt of testing code

//in main ifstream fin("cloud.jpg"); ofstream fout("cloudcpy.jpg");  string data; while ( fin )     fin >> data; fout << data; fin.close(); fout.close();  return 0; 

but output file not copy, more smaller original one. wrong in code?

you may not use string data type. since jpeg file not textfile. please try use primitive type such unsigned char or unsigned int it.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -