Amazon.com Widgets Noob question
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 21, 2014, 03:16:01 AM
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 2 - Programming in Objective-C
| | | |-+ Noob question
Pages: [1] Go Down
Print
Author Topic: Noob question (Read 692 times)
Nic.H...
Newbie
*
Posts: 5






on: August 05, 2011, 09:12:01 AM

Is there a difference between these two lines?

int main (int argc, char *argv[])

and

int main (int argc, const char *argv[])

The book uses them both and i'm trying to figure out if theres a reason why not to use one or why to use the other.
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114







Reply #1 on: August 05, 2011, 12:28:57 PM

No, not really.  THe "const" says that values won't change (in this case the references to the command line arguments).    In practice, it doesn't affect anything here.

Cheers,

Steve
Logged
Pages: [1] Go Up
Print
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.