title: passing different structure type in c for functions
body: <p>I have a  following code :</p>
  
  <pre><code>typedef struct PStruct{
  int len;
  char* data;
  }PointerStruct;
  
  typedef struct AStruct{
  int len;
  char data[256];
  }ArrayStruct;
  
  void checkFunc(PointerStruct* myData)
  {
    if (0 == myData || 0 == myData-&gt;data){
    printf("error\n");
    }
  }
  
  int main()
  {
     ArrayStruct my_data;
     my_data.len = 256;
     char data[] = "data is sent";
     my_data.data = &amp;data;
     checkFunc((PointerStruct*)my_data);
     return 0;
   }
  </code></pre>
  
  <p>is there any wrong in passing structure which has array. where as the required is pointer.
  please let me know.</p>