title: Using pointers as counters in C language
body: <p>So here's the edited code!!
  I am a beginner to C language and I am having problems in printing this pattern. With a request for 3 lines, I should get</p>
  
  <pre><code>*
  **
  ***
  </code></pre>
  
  <p>I am using pointers as counters.  Please help me out.  My code is not working properly..</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main()
     {
    int *a=NULL,*b=NULL,*n=NULL;
    n= malloc (sizeof *n);
    printf("Enter the lines\n");
    scanf("%d",n);
    a= malloc (sizeof *a);
    b= malloc (sizeof *b);
    for (*a=0; *a&lt;*n; *(a)++)
      {
          for (*b=0; *b&lt;=*a; *(b)++)
                  printf("*");
          printf("\n");
      }
   free(n);
   free(a);
   free(b);
   return 0;
     }
  </code></pre>