Hello everybody, to start explaining I first of all need to tell you I’m quite new in this field and I don’t know what is wrong with my code...
I hope this is not a problem with my compiler (Code::Blocks) because it would be a drag to have to reinstall it again(recently I had some problems with my computer but that is not the case anymore), but the next samples I want to attach do not work, because the system doesn’t want to open the files, and I can’t find any problems with them (then again I only started C++ 2 month ago), so please tell me if there is anything wrong with my syntax and I will be very grateful to you. Thank you in anticipation.
Also be aware that with both of your programs the file must exist. With the open modes you're currently using the file won't be created if it doesn't exist.
You may want to have the program tell you a little more information about why the file doesn't open by using the perror() function:
1 2
// In your file open check:
perror ("The following error occurred ");