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

html - Cut text on left side inside button while centering -

java - Last square of 8x8 grid not drawn, using two nested FOR loops -

What design pattern is this code in Javascript? -