Thread: Projects in VC++

  1. #1
    Señor Member
    Join Date
    Jan 2002
    Posts
    560

    Projects in VC++

    I'm making a game that consists of many card games like blackjack and varities of poker. So far, this is my longest program by far. The problem is my single cpp file is very cluttered and it is becoming hard to find some of my smaller functions. I know VC++ has a way of avoiding this by making seperate source files or modules of something. How are the seperate files linked and how should organize them.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    33

    .h

    just make a file and save as blackjack.h or poker.h from your compiler. then on your main file, under all of your #include s, do:
    #include "c:/directory where header files are/poker.h"
    and so forth, very helpfull, also make sure all of the games are functions, if not already done so, it would be really easy that way.

  3. #3
    Señor Member
    Join Date
    Jan 2002
    Posts
    560
    They're not header files. I'd like to have different cpp files. I'm pretty sure you can do that.

  4. #4
    Señor Member
    Join Date
    Jan 2002
    Posts
    560
    Never mind what I just wrote; I misread your post. But do I simply call the functions from blackjack and poker?

  5. #5
    Registered User
    Join Date
    Feb 2002
    Posts
    33
    just put the whole function of a card game in a file like poker.h and call it in your main program, and when you need poker, just call it like you normally would. When chop up your program and put it in different files it will compile the same way as when it was in one file, just a little more organized. and when you put a function in a header file, don't do a int main(), include files or anything etc, it's just source code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. makefile exported by vc 6.0 doesn't work
    By wow in forum Windows Programming
    Replies: 7
    Last Post: 03-24-2006, 04:20 PM
  2. Old VC++ projects
    By geek@02 in forum Windows Programming
    Replies: 1
    Last Post: 03-21-2005, 07:04 AM
  3. Beginner projects
    By MagSteve in forum C++ Programming
    Replies: 4
    Last Post: 05-05-2004, 02:04 AM
  4. Why VC?
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 04-15-2002, 05:24 AM