title: Returning more than one variable using c functions
body: <p>I'm trying to use structure to return more than one variable using following code.</p>
  
  <p>Is there a better way to do this?</p>
  
  <p>and what about this technique, is it efficient? </p>
  
  <p>PS: I'm new to embedded system so trying to discover best techniques for memory , performance and such constrains.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  struct two func(int , int );
  
  struct two {
      int x;
      int y;
  
  };
  
  int main()  {
      printf("values is\n %i\n %i\n ",func(33,44).x,func(33,44).y);
      return 0;
  }
  
  
  struct two func(int x, int y ) {
  
      struct two ex;
      ex.x=x;
      ex.y=y;
  
      return ex;
  };
  </code></pre>