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) Pointers and Memory Pointers

Ryan sTEADMAN
Ryan sTEADMAN
1,600 Points

im stuck

ive crammed too much information. How do you just plain declare a 'char' variable

Simple! To simply declare a char variable you would say:

char x;

Then to assign it a value you would do this:

x = 'hello';

Or, do it 1 step like... char x = 'hello';

2 Answers

Stone Preston
Stone Preston
42,016 Points

declaring a regular vanilla non-pointer variable looks like this generally:

dataType variableName = value;

the challenge tells you what the data type and what the variable named should be, as well as what the value needs to be

Simple! To simply declare a char variable you would say:

char x;

Then to assign it a value you would do this:

x = 'hello';

Or, do it 1 step like... char x = 'hello';