Welcome, Guest. Please login or register.
Did you miss your activation email?
July 27, 2016, 05:55:43 PM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Chapter Study
| | |-+ Chapter 4 - Data Types and Expressions
| | | |-+ Trouble with Exercise 3
Pages: [1] Go Down
Author Topic: Trouble with Exercise 3 (Read 947 times)
Posts: 15

on: May 10, 2011, 10:36:50 AM

I don't understand the program in Exercise 3.  Why is the letter d enclosed in a pair of single quotations, while c is not?  I'm not sure what lesson the program is supposed to illustrate.  Thanks in advance!
Hero Member
Posts: 3114

Reply #1 on: May 10, 2011, 12:28:12 PM

The program is supposed help you understand how to define a char constant, a char variable, and how to assign the former to the latter.   The character in single quote is a char value.  It is assigned to the variable c with a statement like this:

Code: (Objective-C)
c = 'd';


Pages: [1] Go Up
Jump to:

Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.