Datasim Financial Forums Forum Index


 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
C++ Code Optimization

 
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> C++
View previous topic :: View next topic  
Author C++ Code Optimization
admin
Site Admin


Joined: 07 Dec 2006
Posts: 119
Location: Amsterdam, The Netherlands

PostPosted: Wed Jan 27, 2010 1:25 pm    Post subject: Reply with quote

Catching stack overflow

#include <iostream>
#include <windows.h>

using namespace std;

int F(int a)
{
return F(a);
}

void main()
{
__try
{
// Recursive call

F(10);
}
__except(GetExceptionCode() == EXCEPTION_STACK_OVERFLOW? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
{

cout<<"stack overflow error"<<endl;

}
}
Back to top
View user's profile Send private message Visit poster's website
MC



Joined: 16 Feb 2007
Posts: 7
Location: Singapore

PostPosted: Thu May 22, 2008 4:58 am    Post subject: C++ Code Optimization Reply with quote

The Route to C++ Code Optimization Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> C++ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group