[SOLVED]C++ and mbed noob here - how do you set a variable?

13 Mar 2010 . Edited: 14 Mar 2010


Ok, so I did Google it, but it didn't help me. I have the following code:


int main() {
upto = 1;
while upto < 10  {



(That's not the whole lot of it, It's just the bits that are necessary) but it tells me that 'identifier upto is undefined'.


Can anyone help (Or rather, can anyone be bothered to)?

13 Mar 2010

It depends what type of variable you want to use.

Integer is like this: int variableName;

14 Mar 2010

Thanks Vlad :)

Yes, it was integer i wanted to use. Only just found out that you had to put the data type before the value name.

14 Mar 2010

Let me know if you need any other help, or if you are looking to do anything specific with your mbed :)

14 Mar 2010

Ok - cheers :)

15 Mar 2010

Would suggest reading up there are literally thousands of C++ tutorials on the net