Click here to Skip to main content
15,885,767 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: ADO in MFC.....getting problems Pin
User 742933816-Jan-11 4:24
professionalUser 742933816-Jan-11 4:24 
AnswerRe: ADO in MFC.....getting problems Pin
AmbiguousName16-Jan-11 4:30
AmbiguousName16-Jan-11 4:30 
AnswerRe: ADO in MFC.....getting problems Pin
PJ Arends16-Jan-11 11:55
professionalPJ Arends16-Jan-11 11:55 
Questionoperator ":" new for me in C++ Pin
aesthetic.crazy16-Jan-11 0:53
aesthetic.crazy16-Jan-11 0:53 
AnswerRe: operator ":" new for me in C++ Pin
Richard MacCutchan16-Jan-11 1:28
mveRichard MacCutchan16-Jan-11 1:28 
GeneralRe: operator ":" new for me in C++ Pin
aesthetic.crazy16-Jan-11 6:51
aesthetic.crazy16-Jan-11 6:51 
GeneralRe: operator ":" new for me in C++ Pin
Richard MacCutchan16-Jan-11 7:04
mveRichard MacCutchan16-Jan-11 7:04 
AnswerRe: operator ":" new for me in C++ PinPopular
Iain Clarke, Warrior Programmer16-Jan-11 1:36
Iain Clarke, Warrior Programmer16-Jan-11 1:36 
The : is called a colon by me - and many other people
It does different jobs in different places.

Ie:
switch (iValue)
{
case Bob: // Here is a label


   goto finished;
   ....
finished: // also a label
   return bIUseGotos;
}


bSuccess = (pFunction != NULL) ? pFunction->DoSomething () : false; // Here is something else - I think part of a ternary


And in your case, I'll pick a more common example:
class A
{
public:
   A (int i);
};

class B : public A
{
public:
   A ();
}


Now we make a constructor...
B::B ()
{
}


This will not compile - you will get a complaint about A not getting having a constructor with no parameters.
So, we need:
B::B ()
: A (7) // we're calling the A's constructor with a parameter of 7
{
}


The principle is exactly the same for member variables.

In your example, i's constructor is being called with 0. In the case of basic variables, there's an implicit constructor for this. It's not a real one.

As for what you'd call it, I have no idea. Inheritance operator?

Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!

AnswerRe: operator ":" new for me in C++ Pin
Aescleal16-Jan-11 9:01
Aescleal16-Jan-11 9:01 
AnswerRe: operator ":" new for me in C++ Pin
moemass17-Jan-11 3:12
moemass17-Jan-11 3:12 
QuestionHow to get computer color setting? Pin
includeh1015-Jan-11 20:37
includeh1015-Jan-11 20:37 
AnswerRe: How to get computer color setting? Pin
Andrew Brock15-Jan-11 20:53
Andrew Brock15-Jan-11 20:53 
GeneralRe: How to get computer color setting? Pin
includeh1016-Jan-11 2:47
includeh1016-Jan-11 2:47 
GeneralRe: How to get computer color setting? Pin
Andrew Brock16-Jan-11 2:51
Andrew Brock16-Jan-11 2:51 
QuestionSorting data using std::map or std::multimap Pin
cmacgowan15-Jan-11 14:19
cmacgowan15-Jan-11 14:19 
AnswerRe: Sorting data using std::map or std::multimap Pin
Andrew Brock15-Jan-11 18:08
Andrew Brock15-Jan-11 18:08 
GeneralRe: Sorting data using std::map or std::multimap Pin
cmacgowan16-Jan-11 11:01
cmacgowan16-Jan-11 11:01 
AnswerRe: Sorting data using std::map or std::multimap Pin
Aescleal16-Jan-11 6:10
Aescleal16-Jan-11 6:10 
GeneralRe: Sorting data using std::map or std::multimap Pin
cmacgowan16-Jan-11 11:02
cmacgowan16-Jan-11 11:02 
QuestionSoftware Keyboard Simulator Pin
RedDragon2k15-Jan-11 4:48
RedDragon2k15-Jan-11 4:48 
AnswerRe: Software Keyboard Simulator Pin
jschell15-Jan-11 10:02
jschell15-Jan-11 10:02 
AnswerRe: Software Keyboard Simulator Pin
Andrew Brock15-Jan-11 17:16
Andrew Brock15-Jan-11 17:16 
AnswerRe: Software Keyboard Simulator Pin
loyal ginger15-Jan-11 17:25
loyal ginger15-Jan-11 17:25 
GeneralRe: Software Keyboard Simulator Pin
RedDragon2k16-Jan-11 4:11
RedDragon2k16-Jan-11 4:11 
QuestionHow to Set Position where a Window will be minimised Pin
SoftwareDeveloperGoa15-Jan-11 4:42
SoftwareDeveloperGoa15-Jan-11 4:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.