Results 1 to 3 of 3

Thread: How do I use a class from another file(very simple question)

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    47

    Question How do I use a class from another file(very simple question)

    Up to now, I've always been running everything from single files. But now, I've started to learn classes and this approach is no longer practical.

    Essentially, I'm trying to create an instance of a certain class from within a different file (e.g. test file with a main() function).

    How would I do this so my class is recognized from the test file?
    (something like a package in PL/SQL or a package in Java...but how to do in C++??)

    Thanks!!

  2. #2
    Addicted Member NOMADMAN's Avatar
    Join Date
    Aug 2002
    Location
    Closer than you think
    Posts
    237
    I'm not familiar with the PL/SQL. But if yu are asking how to use a class from a header file in your main file its something like this:

    Code:
    #include "classFileName.h"
    
    int main()
    {
       classFileName varible;
    
       return 0;
    }
    Hope this is what you where asking!

    NOMAD

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    47

    Talking Thanks!!

    That's exactly what I was wondering. Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width