How are an object’s data members initialized if a class has only an implicitly defined default constructor?
And why a class might provide a "set" function and a "get" function for a data member?
What is the purpose of the scope resolution operator?
conan19870619
0
Newbie Poster
Recommended Answers
Jump to Post>>How are an object’s data members initialized if a class has only an implicitly defined default constructor
They aren't initialized -- they contain whatever value happens to be there at the time the class object is instantiated. That's the purpose of writing your own constructor.>>And why a class …
Jump to Post>> How are an object’s data members initialized if a class has only an implicitly defined default constructor?
if every non-static member variable of a class has default initialization and no programmer defined constructor is specified, a default constructor is deemed to be declared.if the initialization of all …
All 6 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
vijayan121
1,152
Posting Virtuoso
Ancient Dragon
commented:
good compilete answer
+18
n.aggel
13
Posting Whiz in Training
vijayan121
1,152
Posting Virtuoso
n.aggel
13
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.