Click here to Skip to main content
14,924,621 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question__interface keyword not practicable when derived class exports to dll? Pin
FriendOfAsherah20-Jul-16 23:17
MemberFriendOfAsherah20-Jul-16 23:17 
Questionhow to make steganography in C++ Pin
jhonganteng20-Jul-16 21:35
Memberjhonganteng20-Jul-16 21:35 
AnswerRe: how to make steganography in C++ Pin
CPallini20-Jul-16 22:14
mveCPallini20-Jul-16 22:14 
GeneralRe: Sorry? What is the operator 'shift up' (and 'shift down'?)? Pin
jhonganteng21-Jul-16 4:50
Memberjhonganteng21-Jul-16 4:50 
AnswerRe: how to make steganography in C++ Pin
leon de boer21-Jul-16 1:57
Memberleon de boer21-Jul-16 1:57 
Questionerror 2039 {dtor} is not element of ImyInterface - when does this happen? Pin
FriendOfAsherah20-Jul-16 20:23
MemberFriendOfAsherah20-Jul-16 20:23 
AnswerRe: error 2039 {dtor} is not element of ImyInterface - when does this happen? Pin
FriendOfAsherah20-Jul-16 22:54
MemberFriendOfAsherah20-Jul-16 22:54 
Questionprotected access specifier Pin
kinderu19-Jul-16 4:52
Memberkinderu19-Jul-16 4:52 
Can anyone tell me how can I access the x in the following statement: FirstClass obj3(200, 300);
Here Y = 200, X = 300;
X is initialized by calling the constructor BaseClass(x)
FirstClass inherits BaseClass with protected access specifier.


#include <iostream>
using namespace std;

class BaseClass
{
private:
    int x;
public:
    BaseClass()
    {
        cout << "\n BaseClass(default) called." << endl;
    }
    BaseClass(int x)
    {
        cout << "\n BaseClass(parameters) called." << endl;
        this->x = x;
    }
    int getX()
    {
        return x;
    }
};

class FirstClass:protected BaseClass
{
private:
    int y;
public:
    FirstClass(int y, int x):BaseClass(x)
    {
        cout << "\n FirstClass(parameters) called." << endl;
        this->y = y;
    }
    int getY()
    {
        return y;
    }
};

int main()
{
    BaseClass obj1;
    BaseClass obj2(100);
    cout << "\n X = " << obj2.getX() << endl;
    FirstClass obj3(200, 300);
    cout << "\n Y = " << obj3.getY() << endl;
    return 0;
}

AnswerRe: protected access specifier Pin
Richard MacCutchan19-Jul-16 5:29
mveRichard MacCutchan19-Jul-16 5:29 
GeneralRe: protected access specifier Pin
kinderu19-Jul-16 6:31
Memberkinderu19-Jul-16 6:31 
GeneralRe: protected access specifier Pin
Richard MacCutchan19-Jul-16 7:02
mveRichard MacCutchan19-Jul-16 7:02 
QuestionRe: protected access specifier Pin
David Crow19-Jul-16 17:39
MemberDavid Crow19-Jul-16 17:39 
AnswerRe: protected access specifier Pin
kinderu20-Jul-16 0:05
Memberkinderu20-Jul-16 0:05 
QuestionRe: protected access specifier Pin
David Crow20-Jul-16 2:53
MemberDavid Crow20-Jul-16 2:53 
QuestionRe: protected access specifier Pin
Richard MacCutchan20-Jul-16 22:01
mveRichard MacCutchan20-Jul-16 22:01 
AnswerRe: protected access specifier Pin
kinderu21-Jul-16 1:31
Memberkinderu21-Jul-16 1:31 
GeneralRe: protected access specifier Pin
Richard MacCutchan21-Jul-16 1:36
mveRichard MacCutchan21-Jul-16 1:36 
QuestionDebug COM DLL from ASP.Net Pin
Member 741142218-Jul-16 2:00
MemberMember 741142218-Jul-16 2:00 
QuestionInheritance classes Pin
kinderu16-Jul-16 20:32
Memberkinderu16-Jul-16 20:32 
AnswerRe: Inheritance classes Pin
Daniel Pfeffer16-Jul-16 20:45
professionalDaniel Pfeffer16-Jul-16 20:45 
AnswerRe: Inheritance classes Pin
Albin George18-Jul-16 1:14
MemberAlbin George18-Jul-16 1:14 
QuestionUnmanaged DLL used by C# WPF app not receiving WM_DEVICECHANGE Pin
Leif Simon Goodwin15-Jul-16 3:07
mvaLeif Simon Goodwin15-Jul-16 3:07 
QuestionRe: Unmanaged DLL used by C# WPF app not receiving WM_DEVICECHANGE Pin
David Crow15-Jul-16 5:59
MemberDavid Crow15-Jul-16 5:59 
AnswerRe: Unmanaged DLL used by C# WPF app not receiving WM_DEVICECHANGE Pin
Leif Simon Goodwin17-Jul-16 3:11
mvaLeif Simon Goodwin17-Jul-16 3:11 
AnswerSolved Pin
Leif Simon Goodwin17-Jul-16 20:42
mvaLeif Simon Goodwin17-Jul-16 20: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.