title: How to input any type of data type in scanf?
body: <p>I have a basic problem. I am writing a program where I need to enter data in queue. But the data can be of any type. So how can I use <code>scanf()</code> function if I am not sure about the data specifier. I guess I can make use of unions but how do I proceed?</p>
  
  <p>Sample:</p>
  
  <pre><code>union abc {
      int i;
      float f;
      char c;
  };
  
  
  int main()
  {
      union abc data;
  
      printf("enter data");
      scanf("&lt;----------doubt here
  </code></pre>
  
  <p>I am not sure how to use <code>scanf</code> when we are not sure about the data type that the user can enter.</p>