Thread: Problems grasping .h files...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User FoFGhost's Avatar
    Join Date
    Jun 2011
    Location
    Iowa
    Posts
    10

    Unhappy Problems grasping .h files...

    Decided to make a RPG Adventure game using Allegro and C++ and I want to split my files up. Here's what I would want them to do.

    main.cpp
    Code:
    #include "player_class.cpp"
    #include <allegro.h>
    
    int main(){
      allegro_init();
      return 0;}
    END_OF_MAIN();
    player_class.cpp
    Code:
    #include "player_stats.hpp"
    
    int class_setup(int player_class){
      player_class = 1;
      return player_class;}
    
    player_class = class_setup(player_class);
    player_stats.hpp
    Code:
    int player_class = 0;
    That's the jist of what I want, but I get errors when compiling it. I'm just wondering why that is and how to fix it?
    Last edited by FoFGhost; 06-21-2011 at 09:40 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Not grasping Booleans
    By esmelogo in forum C Programming
    Replies: 2
    Last Post: 11-19-2010, 04:03 AM
  2. Problems with saving files
    By akira181 in forum C++ Programming
    Replies: 5
    Last Post: 05-14-2006, 10:24 AM
  3. Problems using two files
    By dwygal in forum C++ Programming
    Replies: 1
    Last Post: 03-02-2006, 09:15 PM
  4. Problems with Enum and Files
    By Robert_Sitter in forum Windows Programming
    Replies: 7
    Last Post: 11-25-2005, 04:31 PM
  5. Having problems using multiple files
    By crazyeyesz28 in forum C++ Programming
    Replies: 6
    Last Post: 03-22-2005, 06:40 PM

Tags for this Thread