title: plain c using new keyword
body: <p><strong>Overview:</strong></p>
  
  <p>I'm working with a hobby app. I want my program to be able to stick to "plain C".</p>
  
  <p>For several reasons, I have to use a C++ compiler, and the related programming enviroment program, that supports "Plain C". And, for the same reasons, I cannot change to antoher compiler.</p>
  
  <p>And, there are some C++ features that I have been coded, unintentionally.</p>
  
  <p>For example, I'm not using namespaces or classes. My current programming job, is not "plain c" or "c++", and I haven't used them for some time, so, I may have forgotten which stuff is "plain c" only.</p>
  
  <p>I have browsed in the internet, for "Plain C" examples. I have found that many other developers, have also post mixed "plain c" &amp; "c++" examples, (some of them unintentionally).</p>
  
  <p>I'm using some dynamically allocated structures. I have been using "malloc", but I rather use "new" instead. I thought that some new standard &amp; compiler versions of "plain c" allowed "new", but, seems I'm wrong.</p>
  
  <p>Seems that "new" is a "C++" feature, &amp; if I really want to make a only "plain c", I should use "malloc".</p>
  
  <p>The reason I want to stick to "plain C", it's because I'm working in a cross platform non-gui library / tool.</p>
  
  <p>My current platform is "Windowze", my Development Enviroments, are:</p>
  
  <p>(1) <strong>CodeBlocks (MinGW)</strong></p>
  
  <p>(2) <strong>Bloodshed DevCPP</strong></p>
  
  <p>(3) <strong>Borland CBuilder 6</strong></p>
  
  <p>Although, my goal is to migrate it to Linux, too , and maybe other platforms, and other (command-line) compilers.</p>
  
  <p><strong>Quick not Tested Example:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;strings.h&gt;
  
  struct MyData_T
  {
    int  MyInt;
    char MyName[512];
    char *MyCharPtr;
  };
  
  typedef
    struct MyData_T *MyData_P;
  
  MyData_P newData(char* AName)
  {
    MyData_P Result = null;
  
    Result = malloc(sizeof(MyData_T));
  
    strcpy(Result-&gt;MyName, AName, strlen(AName));
    // do other stuff with fields
  
    return Result;
  } // MyData_P newData(...)
  
  int main(...)
  {
    int ErrorCode = 0;
  
    MyData_P MyDataVar = newData("John Doe");
  
    // do more stuff with "MyDataVar";
  
    free(MyDataVar);
  
    return ErrorCode;
  } // int main(...)
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li><p>Where I can get a working "plain c only" compiler for x86 (windowze, linux) ?</p></li>
  <li><p>Should I stick to use "malloc", "calloc", and similar ?</p></li>
  <li><p>Should I consider to change to "C++" &amp; "new", instead ?</p></li>
  <li><p>Is it valid to use "new" &amp; "delete" in a "plain c" application ?</p></li>
  <li><p>Any other suggestion ?</p></li>
  </ol>
  
  <p>Thanks.</p>
  
  <p><strong>Disclaimer</strong>
  Note: I already spent several hours trying not to post the same question, in Stackoverflow, but, none of the previous answers seem clear to me.</p>