October 25, 2014, 09:38:20 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The new Release 13.12 is out! You can download binaries for windows, mac and many major linux distros from .
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: Error using nullptr  (Read 4519 times)
Offline Offline

Posts: 2

« on: August 25, 2011, 06:10:34 pm »

I am studying c++, and the book I'm reading always says to use nullptr instead of null, but this error happens:

error: 'nullptr' was not declared in this scope

I'm missing some #include?

I'm including this:

#include <iostream>
#include <cstring>
#include <stack>
#include <cstdlib>

using namespace std;

Lives here!
Offline Offline

Posts: 4432

« Reply #1 on: August 25, 2011, 06:25:16 pm »

Please learn the difference between an Compiler and an IDE; Code::Blocks is an IDE.
Please read the rules,9996.0.html
Please read how to ask a smart question

Learn to ask programming questions in a site that does this like

Turn on Full Compiler logging to help others help you; note this requires you to post information from the log!!

Tim S.

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
When in doubt, read the CB WiKi FAQ.
Lives here!
Offline Offline

Posts: 3938

« Reply #2 on: August 25, 2011, 09:30:12 pm »

Unless you use something more recent than gcc 4.6 in std=c++0x mode, you must implement nullptr yourself as a template class (or in any other way, constant or macro).

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."
Offline Offline

Posts: 2

« Reply #3 on: August 26, 2011, 12:55:00 am »

Thanks for the replies. Sorry for the wrong question in the wrong forum  Sad
I will read all the links.

Pages: [1]   Go Up
  Send this topic  |  Print  
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!