Thread: Running Normal Functions inside of a class

  1. #1
    Novice C++ Programmer
    Join Date
    Nov 2003
    Posts
    96

    Running Normal Functions inside of a class

    I've been working on a big project and I'm trying to call a function from inside a method definition in a class. The function is outside of the class file entirely but in another source file. The compiler says I'm making a call to an undeclared identifier. So how do you call functions from inside class methods? Thanks.

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    you'll have to include the file that has the prototype, which should be in a header file. If you have this function in your main cpp file, just make an h file for it, and put the prototype in there

  3. #3
    Novice C++ Programmer
    Join Date
    Nov 2003
    Posts
    96
    Quote Originally Posted by skorman00
    you'll have to include the file that has the prototype, which should be in a header file. If you have this function in your main cpp file, just make an h file for it, and put the prototype in there
    Ok fixed it. Thanks. I'm a class newbie

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Read-only class members
    By kidburla in forum C++ Programming
    Replies: 4
    Last Post: 10-14-2006, 12:52 PM
  2. Unresolved external on vector inside class constructor
    By Mario F. in forum C++ Programming
    Replies: 13
    Last Post: 06-20-2006, 12:44 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. template functions inside a class
    By Trauts in forum C++ Programming
    Replies: 8
    Last Post: 03-12-2004, 10:05 PM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM