Skip to content

Instantly share code, notes, and snippets.

@juniorz
Created April 21, 2011 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juniorz/934393 to your computer and use it in GitHub Desktop.
Save juniorz/934393 to your computer and use it in GitHub Desktop.
Como evitar multiplas inclusões de um cabeçalho (C/C++)
/*
Ao usar o ifndef (if not defined) o pre-processador só vai inserir o texto dentro do ifndef
se a constante __D_HEADER__ (deve ser uma constante unica, por isso os __ antes e depois) não estiver definida =D
*/
#ifndef __D_HEADER__
#define __D_HEADER__
/* Assinatura das funções de D.h */
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment