Click here to Skip to main content
15,907,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPrivate Destructor Pin
San27-Nov-08 18:12
San27-Nov-08 18:12 
AnswerRe: Private Destructor Pin
_AnsHUMAN_ 27-Nov-08 18:27
_AnsHUMAN_ 27-Nov-08 18:27 
GeneralRe: Private Destructor Pin
San27-Nov-08 18:39
San27-Nov-08 18:39 
AnswerRe: Private Destructor Pin
Manish K. Agarwal27-Nov-08 18:50
Manish K. Agarwal27-Nov-08 18:50 
GeneralRe: Private Destructor Pin
sheshidar27-Nov-08 19:25
sheshidar27-Nov-08 19:25 
GeneralRe: Private Destructor Pin
Manish K. Agarwal27-Nov-08 22:16
Manish K. Agarwal27-Nov-08 22:16 
GeneralRe: Private Destructor Pin
krishna_CP25-May-10 0:45
krishna_CP25-May-10 0:45 
GeneralRe: Private Destructor Pin
Manish K. Agarwal25-May-10 21:16
Manish K. Agarwal25-May-10 21:16 
here is a minimal example

class A
{
private:
   ~A(){};
public:
   A(){};
   friend void fn();
};

void fn()
{
   A a;
}



In this case if you create a object of class A on stack in any other function other than fn() complier will give you an error C2248: 'A::~A' : cannot access private member declared in class 'A'
Manish Agarwal
manish.k.agarwal @ gmail DOT com

Question0x8009006 Pin
izyani27-Nov-08 15:00
izyani27-Nov-08 15:00 
AnswerRe: 0x8009006 Pin
Randor 27-Nov-08 16:35
professional Randor 27-Nov-08 16:35 
GeneralRe: 0x8009006 Pin
izyani27-Nov-08 16:46
izyani27-Nov-08 16:46 
GeneralRe: 0x8009006 Pin
Randor 27-Nov-08 17:33
professional Randor 27-Nov-08 17:33 
GeneralRe: 0x8009006 Pin
izyani1-Dec-08 16:05
izyani1-Dec-08 16:05 
GeneralRe: 0x8009006 Pin
izyani10-Dec-08 21:25
izyani10-Dec-08 21:25 
Questionfft algorthims in c++ Pin
kamal jit sharma27-Nov-08 8:43
kamal jit sharma27-Nov-08 8:43 
AnswerRe: fft algorthims in c++ Pin
enhzflep27-Nov-08 14:07
enhzflep27-Nov-08 14:07 
GeneralRe: fft algorthims in c++ Pin
CPallini28-Nov-08 0:44
mveCPallini28-Nov-08 0:44 
QuestionBest way of breaking from for loop Pin
vipin_nvk27-Nov-08 4:38
vipin_nvk27-Nov-08 4:38 
AnswerRe: Best way of breaking from for loop Pin
Code-o-mat27-Nov-08 4:49
Code-o-mat27-Nov-08 4:49 
AnswerRe: Best way of breaking from for loop Pin
Roger Stoltz27-Nov-08 4:52
Roger Stoltz27-Nov-08 4:52 
AnswerRe: Best way of breaking from for loop Pin
Paul Conrad27-Nov-08 6:01
professionalPaul Conrad27-Nov-08 6:01 
AnswerRe: Best way of breaking from for loop Pin
CPallini27-Nov-08 7:32
mveCPallini27-Nov-08 7:32 
JokeRe: Best way of breaking from for loop Pin
killabyte28-Nov-08 0:30
killabyte28-Nov-08 0:30 
GeneralRe: Best way of breaking from for loop Pin
CPallini28-Nov-08 0:59
mveCPallini28-Nov-08 0:59 
AnswerRe: Best way of breaking from for loop Pin
sheshidar27-Nov-08 19:31
sheshidar27-Nov-08 19:31 

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.