You are on page 1of 4

Header file

Header file
o Dùng dấu <, > để include từ thư mục include chuẩn.
Ví dụ : #include <iostream.h>
o Dùng dấu ", " để include từ thư mục hiện hành hoặc chỉ định.
Ví dụ : #include "Fibo.h"
#include "usr\Fibo\Fibo.h"

Chương 2 Kỹ thuậ
thuật lậ
lập trì
trình Tờ 28
Header file chứa các nội dung
o Type definitions struct point { int x, y; };
o Function declarations extern int strlen( const char* );
o Inline function declarations inline char get() { return *p++; }
o Data declarations extern int a;
o Constant definitions const float pi = 3.141593;
o Enumerations enum bool { false, true };
o Include directives #include <signal.h>
o Macro definitions #define Case break; case
o Comments /* check for end of file */

Chương 2 Kỹ thuậ
thuật lậ
lập trì
trình Tờ 29
Header file không bao giờ chứa
o Ordinary function definitions char get() { return *p++; }
o Data definitions int a;
o Constant aggregate definitions const tbl[] = { "Ngan hay dai" };

Chương 2 Kỹ thuậ
thuật lậ
lập trì
trình Tờ 30

You might also like