Putting the contents of a binary file into an unsigned char array using ifstream
I have a binary file (filename is in argv[1], size is always 64KiB) which I need to put the contents of into an unsigned char array using ifstream. I have tried to do so using the >> operator, but that only put garbage data into the array.
Having trouble opening a txt file using ifstream in c++
Ive been very stuck on this for a few hours now. I have code that processes a txt file word by word and hashes the input.
However I cant even get my code to open the txt file. I have used both eclipse and visual studio, I made sure the txt file is within the same folder as the other files and in VS I added it to the project. For some reason it works only on visual studio and only with 1 of my 4 files. I think this 1 file started working after I copied the contents to another file for some reason. I recive no errors or warning when building but I keep getting the eroor “Error opening file.” in eclipse and in VS it just crashes. PLS HELP Let me know if you need any context I really appreciate the help.