Class Declaration?

This is a discussion on Class Declaration? within the C++ Programming forums, part of the General Programming Boards category; I am having major problems. I know that you can give a declaration of a function so that you can ...

  1. #1
    Unregistered
    Guest

    Class Declaration?

    I am having major problems. I know that you can give a declaration of a function so that you can create an instance b4 you define the function.... but i need to create an instance of this class before i define it..... is there a way to just give a declaration of a class so that it'll be able to create the type? i would just move the definition above where i create the instance but its got other classes in it and would become incredibly confusing to do that. ideas?

  2. #2
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    A class is first defined before it is instantiated.
    You cannot declare a variable of an unknown type.

    >> I know that you can give a declaration of a function so that you can create an instance b4 you define the function

    You are confused. You cannot declare an instance of a function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 03:35 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM

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