please tell me how to create own header files.Can someone tell me with a small example
please tell me how to create own header files.Can someone tell me with a small example
text editor
man... ppl are so lazy to google these days...
You write them and then you save them as .h extension files. then you include them this way
Code:#include "my_header.h"
Any good IDE (I use Dev-C++) will allow you to create and save header files. They are like .cpp files except that they don't contain a main function. They are used to store variables, functions, and structures.
>They are like .cpp files except that they don't contain a main function.
This works:
Code:/* header.h */ #include <stdio.h> int main ( void ) { printf ( "Hello, world!\n" ); return 0; }It's important to realize that headers are nothing more than a convenient way to organize text that's to be pasted into your code.Code:/* main.c */ #include "header.h"
My best code is written with the delete key.
Prelude: I did know that, however a)I didn't want to confuse him (you won't usually see a header file with main) and b)I didn't really have another way to say it.