Thanks for your replies. The problem has been solved. The above code needs to subtract '0' from the char array during the comparison, so it becomes:
if((position_from[1] - '0') == i)
instead of...
Type: Posts; User: George88
Thanks for your replies. The problem has been solved. The above code needs to subtract '0' from the char array during the comparison, so it becomes:
if((position_from[1] - '0') == i)
instead of...
That's what I want.
Sorry, I don't understand. Would you please be able to explain why? Aren't '0' and '0' the same, which would make the comparison true? Also, this does not explain how I...
I had a cruder form of this code earlier on today, which was working as I wanted it to.
I was testing to see the result of the loop by using a temporary "num" integer variable. I would assign the...
Hi all,
I seem to be having a silly issue with an IF statement that I can't figure out. I'm quite new to C++ but not to code in general. I understand how logical statements work but I might be...
I'm sorry for the confusion.
There are a few reasons I'm using the C++ compiler.
1. I'm going to be applying C++ code and principles to the project as & when I learn it.
2. The original code...
Thanks for the post, but I'm not after help with C++. As I mentioned, it's an old and forgotten C project I am looking to update with newly learned C++ code as I go, but in its current form it's all...
Hi all,
I dug up an old C project of mine that I want to use to apply new principles to in C++. It's a simple text-based game that I can't seem to get working.
Basically, I wrote all the...