Hi all to all.
first post here on the scripts
Maybe someone could explain this to me, why is it that if i open two streams
ifstream in ("some_doc.txt" );
ofstream out ("copy_of_some_ doc.txt")
to 2 txt documents and use
string lines;
while(getline, in) {
in>> line;
out<< line << endl;
}
in.close();
out.close();
i can copy line by line of some_doc to a string, then write the string to the ofstream and it will copy the txt doc exactly line by line to the new doc, copy_of_some_do c.
now my question is, if i use the exact same code but point the istream to a jpeg, ie ("some_image.jp g") and the ofstream ("copy_of_some_ image.jpg"), why does the program not copy the image? when i drag a jpg to my txt editor, it is just a series of lines of characters, surely the streams should just copy them, or am i missing something? why do i not get a copy of the image?
Thanks
bruce
first post here on the scripts
Maybe someone could explain this to me, why is it that if i open two streams
ifstream in ("some_doc.txt" );
ofstream out ("copy_of_some_ doc.txt")
to 2 txt documents and use
string lines;
while(getline, in) {
in>> line;
out<< line << endl;
}
in.close();
out.close();
i can copy line by line of some_doc to a string, then write the string to the ofstream and it will copy the txt doc exactly line by line to the new doc, copy_of_some_do c.
now my question is, if i use the exact same code but point the istream to a jpeg, ie ("some_image.jp g") and the ofstream ("copy_of_some_ image.jpg"), why does the program not copy the image? when i drag a jpg to my txt editor, it is just a series of lines of characters, surely the streams should just copy them, or am i missing something? why do i not get a copy of the image?
Thanks
bruce
Comment