pages

This is a discussion on pages within the C++ Programming forums, part of the General Programming Boards category; ok in dev i dont know when to make a new file but when i look at yours you have ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    196

    pages

    ok in dev i dont know when to make a new file but when i look at yours you have one for the layout the hud and everything so when do i make a new one or could i make a complete game using one page

  2. #2
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341

  3. #3
    Moderately Rabid Decrypt's Avatar
    Join Date
    Feb 2005
    Location
    Milwaukee, WI, USA
    Posts
    300
    I'm not sure what you mean, but it sounds like you're wondering about keeping different parts of a program in separate .cpp files....maybe.

    Correct me if I'm wrong about any of this, but technically, yes, you can keep it all in one file. However, it can be easier to read/debug/change the program if you don't.

    One of the nice things about C++ is the ability to separately compile files within the same project. If you have all of one kind of functions within a separate .cpp (and .h) file, the main function itself is easier to read and follow, which makes debugging and changing the program easier. It also lets you use those functions easily with another program. Instead of re-typing or copy/pasting the code to your new program, you can just #include the header file in the source file that contains int main(), and include the .cpp that corresponds to the header file in your project.
    Just like functions make it easier to do the same calculations over and over within the same program, functions within separate header/source files make it easier to do the same calculations over and over, not only within one program, but within several different programs.

    I hope that's what you were looking for....

    Decrypt
    There is a difference between tedious and difficult.

  4. #4
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    Quote Originally Posted by lilhawk2892
    ok in dev i dont know when to make a new file but when i look at yours you have one for the layout the hud and everything so when do i make a new one or could i make a complete game using one page
    Very ambiguous. Would help if you clarified what you're trying to say here.

  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Erm.....

    Sometimes there are no words.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. handling man (groff) pages in C
    By MK27 in forum Linux Programming
    Replies: 3
    Last Post: 09-12-2008, 12:46 PM
  2. Multiple Pages
    By rehan in forum C++ Programming
    Replies: 4
    Last Post: 09-13-2007, 11:25 AM
  3. To access multiple pages of a file
    By rehan in forum C++ Programming
    Replies: 6
    Last Post: 07-03-2007, 02:15 AM
  4. Determining number of pages in file
    By starkhorn in forum C++ Programming
    Replies: 2
    Last Post: 08-26-2004, 09:53 PM
  5. HTML Man Pages?
    By mart_man00 in forum Tech Board
    Replies: 1
    Last Post: 04-16-2003, 03:13 PM

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