If anyone could help me I am writing this program that takes a users amount of money and tells them one possible amount of coins they have. When I try to compile this program in codeblocks I get an error that says;
error: no match for 'operator!=' in 'leave != exit'
I'm not completely sure, but I can spot one error already.
Because leave is a string, you're wanting the user to input "exit" at the end to leave, right? Anyway, to get a string's input, you got to have quotation marks around them. So if you want to get leave, try this. if (leave != "exit")
I'm new to cpp and I have a small query about this and many other examples that I have been checking out during my research. I didn't want to start a new thread for a small question. Why declare "using namespace std" and then use "std" again in the code?
Also Dark Water Syntax, I'm from a Java background, so it will take me a while to work your problem out, but I think that it's more than just one issue. Someone else will probably work it out quicker than me.
Cheers,
GM
Edit: Ok, I just had a look through your code. Firstly I can't stand "while (true)". It should be something like "while(condition)", i.e. while "(leave != "exit")" (<<< "This is prob not the best example, because you will get an infinite loop if you type in text at the wrong time") and not use "break". I'm working on understanding the purpose of the program and then I should be able to provide a solution, like I said I am new (2 days now, yay).