title: Using Function Templates
body: <p>I have created a structure of different data types and i want to return each type of data. does this can be done using a function template which takes a different data argument not included in structure or no arguments?</p>
  
  <p>I have something like this,</p>
  
  <pre><code>struct mystruct{
  int _int;
  char _c;
  string _str
  };
  
  In function template(int i)
  {
       mystruct s;
  
        switch (getInput)
       {
        case 1:
          return s._int;
        case 2:
          return s._c;
        case 3:
          return s._str;
     }   
  } 
  
  void main()  
  
  {
     int getInput = 1;
     //pass getInput value to function template
  }
  </code></pre>