Click here to Skip to main content
15,889,595 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Randomizing in c++ Pin
CPallini20-Mar-08 23:05
mveCPallini20-Mar-08 23:05 
GeneralRe: Randomizing in c++ Pin
toxcct20-Mar-08 23:40
toxcct20-Mar-08 23:40 
GeneralRe: Randomizing in c++ Pin
Capitanevs21-Mar-08 2:18
Capitanevs21-Mar-08 2:18 
GeneralRe: Randomizing in c++ Pin
David Crow21-Mar-08 3:34
David Crow21-Mar-08 3:34 
QuestionNeed help on outlook addin Pin
manish.patel20-Mar-08 19:23
manish.patel20-Mar-08 19:23 
Generalerror C2668: 'sqrt' : ambiguous call Pin
gentleguy20-Mar-08 17:29
gentleguy20-Mar-08 17:29 
GeneralRe: error C2668: 'sqrt' : ambiguous call Pin
Mark Salsbery20-Mar-08 17:42
Mark Salsbery20-Mar-08 17:42 
Generalauto_ptr compile error Pin
George_George20-Mar-08 16:59
George_George20-Mar-08 16:59 
Hello everyone,


Two questions,

1.

The following compiler error from the following code segment, is because delete statement from destructor of auto_ptr requires the declaration of destructor of wrapped object?

1>main.cpp
1>d:\visual studio 2008\projects\test_autoptr2\test_autoptr2\main.cpp(10) : error C2512: 'Foo' : no appropriate default constructor available

#include <memory>
#include <iostream>

using namespace std;

class Foo;

void func()
{
	auto_ptr<Foo> pf (new Foo());

	cout << "I am here. " << endl;

	return;
}

int main()
{
	func();

	return 0;
}

class Foo {
};


2.

If yes, how to define a destructor outside of the body of class declaration? I defined in this way, but compile can not pass.

Foo::~Foo()
{

}



thanks in advance,
George
QuestionRe: auto_ptr compile error Pin
Rajkumar R20-Mar-08 22:55
Rajkumar R20-Mar-08 22:55 
GeneralRe: auto_ptr compile error Pin
George_George20-Mar-08 23:40
George_George20-Mar-08 23:40 
GeneralRe: auto_ptr compile error Pin
Rajkumar R21-Mar-08 0:14
Rajkumar R21-Mar-08 0:14 
GeneralRe: auto_ptr compile error Pin
George_George21-Mar-08 0:27
George_George21-Mar-08 0:27 
GeneralRe: auto_ptr compile error Pin
Rajkumar R21-Mar-08 0:31
Rajkumar R21-Mar-08 0:31 
GeneralRe: auto_ptr compile error Pin
George_George21-Mar-08 0:46
George_George21-Mar-08 0:46 
GeneralRe: auto_ptr compile error [modified] Pin
Rajkumar R21-Mar-08 1:19
Rajkumar R21-Mar-08 1:19 
GeneralRe: auto_ptr compile error Pin
George_George21-Mar-08 20:58
George_George21-Mar-08 20:58 
Questionhow can i export a function of a class? Pin
alphaxz20-Mar-08 16:21
alphaxz20-Mar-08 16:21 
AnswerRe: how can i export a function of a class? Pin
David Crow20-Mar-08 16:39
David Crow20-Mar-08 16:39 
GeneralRe: how can i export a function of a class? Pin
Mark Salsbery20-Mar-08 16:53
Mark Salsbery20-Mar-08 16:53 
GeneralRe: how can i export a function of a class? Pin
alphaxz20-Mar-08 18:14
alphaxz20-Mar-08 18:14 
GeneralRe: how can i export a function of a class? Pin
Mark Salsbery20-Mar-08 21:04
Mark Salsbery20-Mar-08 21:04 
GeneralRe: how can i export a function of a class? Pin
CPallini20-Mar-08 21:51
mveCPallini20-Mar-08 21:51 
GeneralRe: how can i export a function of a class? Pin
Mark Salsbery21-Mar-08 5:52
Mark Salsbery21-Mar-08 5:52 
GeneralRe: how can i export a function of a class? Pin
CPallini21-Mar-08 7:12
mveCPallini21-Mar-08 7:12 
QuestionRe: how can i export a function of a class? Pin
David Crow21-Mar-08 3:15
David Crow21-Mar-08 3:15 

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.