What is ther difference between these two functions
Code:List::List(): head_(0) {} AND List::List() { head_=0 ; } //are they both doing the same thing if so what is the : doing?
What is ther difference between these two functions
Code:List::List(): head_(0) {} AND List::List() { head_=0 ; } //are they both doing the same thing if so what is the : doing?
Maybe this will help:
http://cboard.cprogramming.com/showt...ht=initializer
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Nobody can answere this question!!!!!!!!!!!!!!!!!!!!!!!!!!!
They are called initializers......read up on them.
Knowledge is power and I want it all
-0RealityFusion0-
It's funny I didn't see these at all in my C++ book, then again it is Herb Shildt. (don't panic I'm buying some more soon).
Drew, JaWiB answered your question very well....did you even click the link?!
Thor's self help tip:
Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.
OS: Windows XP
Compiler: MSVC