@Ch1156
Code::Blocks seems to segfault just prior to
return 0;
(line 26) in the Debug Target for some reason, but not in the Release Target, which is annoying - there is nothing wrong with the functioning of the code and this doesn't happen with other IDE's I have used. I put a
std::cout
on line 25 and it worked.
@kemort
I have never maintained otherwise and wouldn't.
As I said I was well aware of the warnings and that's all they are - warnings - albeit pedantic. |
Ok, I get that. I recommended that the OP use your code, I am sure he appreciates your effort, and I think that it has helped him.
Sorry to be so stubborn, but ......
1. I guess the compiler considers lines 9 & 10 to be initialisation - which it is, really.
2. Ok
3. I still think you are wrong about that. The compiler has
changed "??!"
to
"|"
, which affects the output making it different to what might have been expected. Even though your program isn't doing decryption, it is not doing the encryption as expected (at least for some compilers). I would rather know about it now, so some action could be taken. I changed the
"??!"
to
"*?!"
, so it is no longer a tri-graph. The other thing to do would be to disable trigraphs with the appropriate compiler flag.
-Wno-trigraphs
And it is a fault in the construction of the string array - if you look at the output, there is no
"??!"
, it is changed to
"|"
. The "sensible reason" why it would change the value,
is that it is a trigraph. And it is not a compiler bug, Trigraphs are enabled with -Wall under g++ . Although I had read somewhere that Trigraphs are being removed in C++17 standard? Even if whatever compiler being used is not the latest - it is still a problem isn't it? Had this warning not been mentioned, it would have caused the OP problems.
Anyway, the problems were easily fixed - and I am voting that we have given this enough air time already.