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 trialRyan sTEADMAN
1,600 Pointsim stuck
ive crammed too much information. How do you just plain declare a 'char' variable
2 Answers
Stone Preston
42,016 Pointsdeclaring 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
Alan Scarpa
3,540 PointsSimple! 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';
Alan Scarpa
3,540 PointsAlan Scarpa
3,540 PointsSimple! 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';