title: Searching in array of struct in C
body: <p>How to search on char that has been randomly generated in an array of structures. 
  If char is found the function must return the <code>info[i].num</code>  in array of struct, where info is the array of structures (see code below).</p>
  
  <p>I got error in <code>gcc</code> </p>
  
  <pre><code> warning: comparison between pointer and integer
   if(info[j].name == s );
  </code></pre>
  
  <p>how can I use correct comparison ??</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include&lt;string.h&gt;
  #define InfoSize  3 
  
  int main(int argc, char *argv[]) 
  {  
  char arr[20];
  struct st
  {    
      char name[20];  
      int num[5];   
  }; 
  
  struct st info[InfoSize] = {{ "some10",6 },{"some50",8},{"some5",4}};
  
           int r = rand() % (50 + 1 - 10) + 10 ;
           char s = sprintf( arr, "some%d", r );
  
  
    for(int j=0;j&lt;3;j++){
  
       if(info[j].name == s )
       printf("found  %s  and it's num =%d",info[j].name,info[j].num);
  
  }
  </code></pre>