My special .h file!!

This is a discussion on My special .h file!! within the C++ Programming forums, part of the General Programming Boards category; I am now also creating my own .h files. (Header files). I have made one that isn't too good but ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Talking My special .h file!!

    I am now also creating my own .h files. (Header files). I have made one that isn't too good but it has functions to calculate circumference and radius of a circle. Also, it has a function for the area of a square. If you would like to use it lemme know.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    Does the header file do that or does the class implementation of the header file do that?
    Blue

  3. #3
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490
    Does the header file do that or does the class implementation of the header file do that?

    What do you mean?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  4. #4
    Registered User dirkduck's Avatar
    Join Date
    Aug 2001
    Posts
    428
    generally a header file will just all you to use functions defined in it that are actually in a different .c/.cpp or .dll file

  5. #5
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Post Yes they...

    They use other functions in iostream.h uses cout. also has int name(...){ // code }, etc.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  6. #6
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Arrow I will attach another .h file...

    I am going to attach my test header that draws a rectangle. It was very simple to do.
    Attached Files Attached Files
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  7. #7
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    Code:
    file.h
    
    //++++++++++++++
    
    #ifndef CLAS
    #define CLAS
    
    
    class Clas
    {
    
      public:
    
                 void hello(void);
    
    };//end class
    
    #endif
    
    //+++++++++++++++
    
    file.cpp
    
    //+++++++++++++++
    
    #include "file.h"
    #include <iostream>
    using namespace std;
    
    void Clas::hello(void)
    {
       cout << "Hello" << endl;
    }
    
    //+++++++++++++++
    
    driver.cpp
    
    //+++++++++++++++
    
    #include "file.h"
    int main()
    {
    
      Clas umm;
    
      umm.hello();
    
    return 0;
    
    }
    
    //++++++++++++++++
    This is what we mean.........
    Last edited by Betazep; 02-03-2002 at 07:54 PM.
    Blue

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  3. #include header files or .cpp files?
    By DoctorX in forum C++ Programming
    Replies: 3
    Last Post: 12-23-2006, 11:21 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

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