auto_ptr

This is a discussion on auto_ptr within the C++ Programming forums, part of the General Programming Boards category; Hi, I have got a problem that i cant seem to fix , I wanted to implement auto pointers into ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    Unhappy auto_ptr

    Hi,

    I have got a problem that i cant seem to fix ,

    I wanted to implement auto pointers into an application that im doing, but the problem is that the compiler fails.

    here is a code snippet

    #include <memory>

    class Name
    {
    Name();
    ~Name();
    };


    int main(void)
    {
    auto_ptr <Name> SafePtrName;
    ...
    ...
    ...
    return 0;
    }

    the compiler comes up with three errors, two syntax and one say that says its missing storage-class or type specifiers

    Is there a library that i need to add or another header file to include???

    Please could someone help as I have tried making new projects within visual studio .net and still getting the same result

    Thanks in advance

    Hyder Ali

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    201
    as always standard library thingies are in the std namespace

    std::auto_ptr

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21