Thread: #include files

  1. #1
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361

    Question #include files

    Can someone give me a link to which #include files do what. How and where do i get sprites and include them in my games?

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Here is a link to the ANSI standard ones.

    http://www.themost.org/courses/langs...ns/eoc_11.html

  3. #3
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    Stan instead of posting a question everytime you get to a small hurdle you wish to cross I have a suggestion for you :

    By a book about Windows game programming and download the DirectX 7 docs...

    Step #1 Read the book.
    Step #2 Read the docs.

    Now repeat the process several times, you should have an understanding of how to load a bitmap file to the screen via DirectX. Alas you need the DirectX SDK! What now!? Well you download the 'SDK' from microsoft's website.

    Although this maybe more than you can chew, it is what you got to do. One more thing, you can see what is in a header file by... opening it.

  4. #4
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361

    Angry Gimme a break

    Yo, I'm only 13 dude, and I've been doing this for about 2mths. Maybe I need a better book because Sams Teach Yourself C++ in 24 hours isn't helping. I'm trying to do the best I can. Chill

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    *sigh* this isn't that hard to understand. And by the way, any book with a title such as "Become a millionaire in just one month" or "Sailing for dummies" is not the best place to start.

    Code:
    //this is main.c
    #include <iostream>
    #include "myfile.h"
    
    int MyClass :: stuff() {
       return this->x;
    }
    
    void MyClass :: whatever(int &n) {
        n = this->y;
    }
    
    int main() {
        MyClass mc;
        cout << mc.stuff();
    }
    Here is what myfile.h looks like.

    Code:
    class MyClass {
    private:
        int x, y;
    public:
        int stuff();
        void whatever(int &);
    };
    This is pretty basic here. My header file just declares all the functions and classes that my c file contains. In this case I only have prototyped a single class. The c file just defines the class' functions.

    This is why header files are there. Okay, i'm sure you are familiar with all this. My point here is that rather than focusing on what each header contains, you should focus on learning what functions and classes you need. From that you will memorize the headers that you use most.

  6. #6
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by master5001
    And by the way, any book with a title such as "Become a millionaire in just one month" or "Sailing for dummies" is not the best place to start.
    Windows Game Programming for Dummies is a good book.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Sang-drax, I can't disagree there but "Sams Teach Yourself C++ in 24 hours" is not. My point was not that books that contain the word "dummy" in the title are bad. My point was books that have overly ambitious titles are bad. Books like "Sams Teach Yourself C++ in 24 hours" are very effective if you have some programming background, otherwise you end up like poor stan over here.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 06:23 AM
  2. Header file include order
    By cunnus88 in forum C++ Programming
    Replies: 6
    Last Post: 05-17-2006, 03:22 PM
  3. include files that are'nt in compiler's directory
    By vaibhav in forum C++ Programming
    Replies: 10
    Last Post: 03-25-2006, 11:45 AM
  4. Include files
    By disruptivetech in forum C++ Programming
    Replies: 7
    Last Post: 07-12-2005, 09:52 AM
  5. include library header in header files
    By Raison in forum C++ Programming
    Replies: 6
    Last Post: 09-27-2004, 02:50 AM