Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Objective-C Basics (Retired) Fundamentals of C Operators & Expressions

Auto incrementing Unstable

In the quiz I'm asked to auto increment Unstable. Currently unstable = 25. Then it was reduced by 5 (unstable -= 5) and now I'm being asked to auto increment "unstable," but for the life of me I can't figure it out. Help.

5 Answers

Stone Preston
Stone Preston
42,016 Points

neither of those are the correct use of the postfix ++ operator. the postfix ++ operator goes after the variable name like so:

variableName++;
Stone Preston
Stone Preston
42,016 Points

Here is a hint: you need to use the auto incrementing operator which is ++. use the postfix style syntax.

I thought I did...

Here is what I tried:

unstable = ++

unstable += 1

and neither were successful.

Thanks!

Do you mean like this:

unstable = 25++

Stone Preston
Stone Preston
42,016 Points

no, to auto increment a variable all you need to do is

variableName++;

you dont need an equal sign, or any specific number values.

Thanks! I finally got it. Sheesh!