ILE C/C++ Programmer's Guide

Members of a Structure

C++ language onlyIn ILE C++, if a _DecimalT class template is a member of a struct, that struct cannot be initialized with an initializer list.

C language onlyThe structure in ILE C is shown in the following figure:

Figure 206. Example of ILE C Structure Definition that Cannot Be Ported to ILE C++


typedef struct {
  char          s1;
  decimal(5,3)  s2;
}s_type;
 
s_type s ={'+', 12.345d};

C++ language only In ILE C++ you need to rewrite the code as shown in the following figure:

Figure 207.


struct s_type {
   char s1;
   decimal(5,3) s2;
   s_type (char  c, decimal(5,3) d ) : s1(c), s2(d) {}
};
s_type s ('+', __D("12.345")) ;


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