ILE C/C++ Programmer's Guide

Resolving Integer Data Type Size Issues

C++ language onlyIn ILE C++, the enum size is always the size of an integer unless the #pragma enum directive is used.

To resolve any problem with the enum type size, use the #pragma enum directive, as shown in the following figure:

Figure 229. Example of #pragma enum Directive that Resolves Data Type Size Issues


  .
  .
#pragma enum (2)
  enum { a=0xffff} A; //sizeof(A)=2;
#pragma enum ()
  .
  .


[ Top of Page | Previous Page | Next Page | Table of Contents ]