title: Dynamically create an array of TYPE in C
body: <p>I've seen many posts for c++/java, but nothing for C. Is it possible to allocate memory for an array of type X dynamically during run time? For example, in pseudo, </p>
  
  <pre><code>switch(data_type) 
       case1:float, create a new array of floats to use in the rest of the program
       case2:int, create new array of ints to use in the rest of the program
       case3:unsigned, ....
       // etc.
  </code></pre>
  
  <p>In my program I determine the data type from a text header file during run time, and then I need to create an appropriate array to store/manipulate data. Is there some kind of generic type in C?</p>
  
  <p>EDIT: I need to dynamically create and DECIDE which array should be created.</p>
  
  <p>Thanks,
  csand</p>