C/Macro Preprocessor/Preprocessor — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
(нет различий)

Версия 14:20, 25 мая 2010

Define preprocessor for char set

#include <stdio.h>
/* define CHAR_SET as either 256 or 128 */
#define CHAR_SET 256
int main(void)
{
  int i;
  
#if CHAR_SET == 256
  printf("Displaying full ASCII character set plus extensions.\n");
#else
  printf("Displaying only ASCII character set.\n");
#endif
  for(i = 0; i < CHAR_SET; i++)
    printf("%c", i);
  return 0;
}