C - Conditional Compilation2

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Conditional Compilation ...

  • e.g, 1

To make sure that the contents of file hdr.h are included only once, the contents of the file are surrounded with a condition like this

#if  !defined(HDR)
#define   HDR
// contents of hdr.h go here
  • e.g, 2
#ifdef identifier   is equ  #if defined    identifier
#ifndef             is equ  #if !defined identifier