Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!