Click here to Skip to main content
15,944,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Read buffer into a string. Pin
CodingLover28-Jan-08 22:17
CodingLover28-Jan-08 22:17 
GeneralRe: Read buffer into a string. Pin
CPallini28-Jan-08 22:46
mveCPallini28-Jan-08 22:46 
GeneralRe: Read buffer into a string. Pin
CodingLover29-Jan-08 0:13
CodingLover29-Jan-08 0:13 
Generalexception and global variable Pin
George_George27-Jan-08 22:34
George_George27-Jan-08 22:34 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 22:47
Maxwell Chen27-Jan-08 22:47 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:08
George_George27-Jan-08 23:08 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:02
Maxwell Chen27-Jan-08 23:02 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:08
George_George27-Jan-08 23:08 
Hi Maxwell,


Here is my code to verify exception from constructor of global variable could be caught and handled. Anything wrong?

using namespace std;

class Foo{

public:

	Foo ();
};

Foo::Foo()
try{
	cout << "constructing" << endl;

	throw(0);

} catch (...)
{
	cout << "catch exception in constructor" << endl;
}


Foo foo;

int main()
{
	int i = 0;

	cout << i;

	return 0;
}



regards,
George
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:11
Maxwell Chen27-Jan-08 23:11 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:15
Maxwell Chen27-Jan-08 23:15 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:42
George_George27-Jan-08 23:42 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:45
Maxwell Chen27-Jan-08 23:45 
GeneralRe: exception and global variable Pin
George_George28-Jan-08 0:06
George_George28-Jan-08 0:06 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:16
George_George27-Jan-08 23:16 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:19
Maxwell Chen27-Jan-08 23:19 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:31
George_George27-Jan-08 23:31 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:34
Maxwell Chen27-Jan-08 23:34 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:40
George_George27-Jan-08 23:40 
GeneralRe: exception and global variable Pin
CPallini27-Jan-08 23:32
mveCPallini27-Jan-08 23:32 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:36
George_George27-Jan-08 23:36 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:40
Maxwell Chen27-Jan-08 23:40 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:45
George_George27-Jan-08 23:45 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:54
Maxwell Chen27-Jan-08 23:54 
GeneralRe: exception and global variable Pin
CPallini27-Jan-08 23:45
mveCPallini27-Jan-08 23:45 
JokeRe: exception and global variable Pin
Cedric Moonen27-Jan-08 23:48
Cedric Moonen27-Jan-08 23:48 

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.