C/Macro Preprocessor/Preprocessor


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Перейти к: навигация, поиск

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;
}