Link to home
Start Free TrialLog in
Avatar of johnewingfr
johnewingfr

asked on

error C2039: 'bad_alloc' : is not a member of 'std'

Visual C++ 2005 running in Visual Studio Professional

When I type this:

try {
    dk->tkBuf = new TOKEN[lgTkBuf];
    }
catch (std::bad_alloc& ba){}

as I type the std::  the editor obligingly displays a member list for std which includes , but when I compile it I'm told:

error C2039: 'bad_alloc' : is not a member of 'std'

Anyone any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnewingfr
johnewingfr

ASKER

Dang!!!  I *had* added it, but *before* #include "stdafx.h" so it wasn't being looked at.

I've been banging my head off that for two hours.  Thanks for making me look again.
Heh ... it happens to all of us :)