title: Why does the compilation fail with error: conversion to non-scalar type requested
body: <p><strong>Program:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  struct s
  {
      int a;
      struct x
      {
          int b;
      }*p;
  };
  int main()
  {
      struct s *a;
      a=(struct s *)malloc(sizeof(struct s) * 10);
      a-&gt;p=(struct x)malloc(sizeof(struct x));
      return 0;
  }
  </code></pre>
  
  <p><strong>Error:-  In function 'main': 16:41: error: conversion to non-scalar type requested      a->p=(struct x)malloc(sizeof(struct x));                                          ^</strong></p>