Given an integer variable strawsOnCamel , write a statement that uses the auto-increment operator to increase the value of that variable by 1.
i wrote this (strawsOnCamel+1);, got an error
also tried this (strawsOnCamel++); got an error
i don't understand why i'm getting an error.
i am a very beginner to c++ taken a class online to learn more about this powerful language any help would be much appreciated.
thank you
Well, the thing is that both of those should compile, but only if I make a few assumptions...
Could we see the full code that isn't compiling? That would really help. ^_^
-Albatross
P.S: Could you tell me which of those two statements contains the increment operator? *hint* *hint*
Hello
i believe the increment is ++ ?
:) am i right ? this is pretty cool stuff
i took out the ( ) and it was correct :)
Final answer strawsOnCamel++;
Last edited on