Using namespace std
various declarations... including pause and fin
char* buffer;
int last;
fin.open(Parent_file.c_str());
last = ceil(end);
cout << last;
buffer = newchar [last];
fin.read(buffer,end);
fin.close();
cout << buffer;
pause();
the output of the program through cout shows a large sum of what seem to be equal signs. When put into a file (which is done later in the code, not included), they give a very strange I with a ' or ` or some similar mark above it, instead of the data inside Parent_file.c_str(), which is a standard txt file from notepad (windows mind you).
Why does this happen, and how can i fix it and thus make it equal to the string of data in Parent_file?
please don't point me to the istream::read page. i've been there many a time, i need a little more personal help.
I like that! You're hidding your pause function, that's smooth... That way the trolls can't call you on what they don't see.
If the "very strange 'I' " you describe was either ï, î, or ì then it's because the value that it read stretched into the extended ASCII table. How do you define the 'end' value used in lines 7 and 10?
ha! i didn't even think of that, i've just come to the habit of doing that myself because of how often i call it in any of my projects.
the i was capitalized "Í" is the exact character. and it appears for all characters (yes i have multiple 4kb files with this as it's only character, it's quite displeasing to look at, like having everything you've worked on for the last two weeks rubbed in your face as 'not good enough' :P).
end is the size of the file in bytes, the reason i have that conversion there is because originally end was a float type so i could convert it to kilobytes.
EDIT: when i make buffer = a set of example text, these characters and such don't appear. It was probably obvious that this would happen but i dunno what you guys might need to answer my question :P