Hi,
The code is perfectly normal, as far as I can see.
Can you provide us with your full code and better describe the problem you are trying to deal with?
EDIT: (After 5 hours), i didnt see +coder777 because we was posted EXACTLY at the same time :), DONT READ THIS PART PLEASE!
Same error's
There's how to:
1 2 3 4
fen = "EncryptResultText"; //Base text
ifen2= ifen2 + 1; //An number, to be diferent with other's in this sesios (unit program is closed)
fen3= ".txt"; //The file termination
fen4= fen + fen2 + fen3; //Combine them all
The eloop and dloop are just another surce file's, no problem with then.
You try to isolate the problem. Make a copy of main.cpp. Then you try removing some random part of your main.cpp you suspect there may be errors (by using cut) and compile the code. If your code does not compile, undo the action and try it elsewhere. If your code compiles successfully, post the "malfunction" code that causes the compiler errors here.
||=== Build: Debug in PR Encrypt messages (compiler: GNU GCC Compiler) ===|
F:\Projects\C++\Code Blocks\Mine\PR Encrypt messages\main.cpp||In function 'int main()':|
F:\Projects\C++\Code Blocks\Mine\PR Encrypt messages\main.cpp|48|error: could not convert 'myfile.std::basic_ofstream<_CharT, _Traits>::open<char, std::char_traits<char> >(fen4.std::basic_string<_CharT, _Traits, _Alloc>::c_str<char, std::char_traits<char>, std::allocator<char> >(), std::operator|((std::_Ios_Openmode)16u, (std::_Ios_Openmode)32u))' from 'void' to 'bool'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
EDIT: I replaced the wrong error part, accidentaly copyed from another way, now its fixed (ONLY IN THIS REPLY!)
EDIT2: I remaked the code, cuting an non-so important part, i cutted some goto, NO MAJORLY CHANGING, Still This error.
+AvstractionAnon
LINE 48: I still dont understand how to use it ..., can i hace an example?
LINE 47-48: Sorry, a typo mistake, i didnt wanted to do that, but thanks for seeing it!
if (myfile.open, std::ofstream::out | std::ofstream::app)
// ^^^^^^^^^^^ - That's a function address, not a function call
// ^ - That's a misuse of the comma operator
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Those are only valid on a function call to open
Try this:
1 2 3
ofstream myfile (fen4.c_str());
if (myfile.is_open())
{ ...