Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Linking an externaly defined C++ class

Options
  • 27-02-2001 6:49pm
    #1
    Registered Users Posts: 3,308 ✭✭✭


    Ignore this post lads. I figured it out. Damn I'm simple.

    Hi guys,
    I usually code in C not C++. But I want to have my main linked list as c++ class objects instead of C structs in a program i'm doing. I'd normally define the struct then simply go

    struct my_struct *my_instance;

    I cant do this with c++. I have player_connect class defined in a file. But how do I refer to it in my main file? I tried
    class player_connect *my_instance;
    with no luck. I tried defineing it as an extern. What is the syntax I need to do? I am linking in player_connect.o in the makefile.
    Its under gnu cpp. Thanks for any help you can give me
    quozl


    [This message has been edited by quozl (edited 27-02-2001).]


Advertisement