title: C++ struct testing
body: <p>Hi I am new to C++ and testing a structure in a c++ code in dev-c++. but it is not compiling and giving errors .
  It is working well with .h extensions in pre-processor directives in dev-c++. so i Dont think so it carries .h extension problems</p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;iomanip.h&gt;
  struct car
  {
    const int MAX=10;
    char model[MAX];
    char spare_part[MAX];
    float cost;        
  
            }
  int main()
  {
  
      car BMW ;
      BMW.model[MAX]="SLR-8 S";
      BMW.spare_part[MAX]="SILENCER";
      BMW.cost=175.56F;
  
  
      cout &lt;&lt; setw(50) &lt;&lt; "\n\n WELCOME TO SHOWROOM" &lt;&lt; endl &lt;&lt; endl;
      cout &lt;&lt;  "CAR MODEL: " &lt;&lt; BMW.model[MAX] &lt;&lt; endl;
      cout &lt;&lt; "SPARE PART: " &lt;&lt; BMW.spare_part[MAX] &lt;&lt; endl;
      cout &lt;&lt; "COST OF PRODUCT: " &lt;&lt; BMW.cost[MAX] &lt;&lt; endl;  
      return 0;
      }
  </code></pre>
  
  <p>Compiler logs are:</p>
  
  <pre><code>Compiler: Default compiler
  Executing  g++.exe...
  g++.exe "D:\cdev\projects\structure.cpp" -o "D:\cdev\projects\structure.exe"    -I"D:\cdev\Dev-Cpp\lib\gcc\mingw32\3.4.2\include"  -I"D:\cdev\Dev-Cpp\include\c++\3.4.2\backward"  -I"D:\cdev\Dev-Cpp\include\c++\3.4.2\mingw32"  -I"D:\cdev\Dev-Cpp\include\c++\3.4.2"  -I"D:\cdev\Dev-Cpp\include"   -L"D:\cdev\Dev-Cpp\lib" 
  In file included from D:/cdev/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
               from D:\cdev\projects\structure.cpp:1:
  
  D:/cdev/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;iostream&gt; instead of the deprecated header &lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.
  
  D:\cdev\projects\structure.cpp:6: error: ISO C++ forbids initialization of member `MAX'
  
  D:\cdev\projects\structure.cpp:6: error: making `MAX' static
  
  D:\cdev\projects\structure.cpp:13: error: new types may not be defined in a return type
  
  D:\cdev\projects\structure.cpp:13: error: extraneous `int' ignored
  
  D:\cdev\projects\structure.cpp:13: error: `main' must return `int'
  
  D:\cdev\projects\structure.cpp: In function `int main(...)':
  
  D:\cdev\projects\structure.cpp:16: error: `MAX' undeclared (first use this function)
  
  D:\cdev\projects\structure.cpp:16: error: (Each undeclared identifier is reported only 
  once for each function it appears in.)
  
  Execution terminated
  </code></pre>