This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ & gcc


>>>>> "Vladimir" ==   <v.pekar@web.de> writes:

    Vladimir> Hi!  I have following problem: I have a piece of C code,
    Vladimir> which can be compiled with gcc, but if I try to compile
    Vladimir> it with g++ (I need it, because I'm going to use
    Vladimir> io-streams), I get some errors of the kind: implicit
    Vladimir> decloration of the function 'int atoi(...)' (the same
    Vladimir> for bcopy(...) and bzero(...)).  What do I do wrong
    Vladimir> here?  thank you Vladimir


Well, 'man atoi' reveals:

-----------------------------------------
SYNOPSIS
       #include <stdlib.h>

       int atoi(const char *nptr);
-----------------------------------------

So, for C++ you'd need to

#include <cstdlib>

Claudio


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]