title: I'm writing a C program on visual studio. But my program doesn't run nor it returns any errors. Can someone take a look at it?
body: <p>I hopelessly tried to copy paste this into another file but it still doesn't return anything. </p>
  
  <pre><code>#include "stdio.h"
  #include "stdlib.h"
  #include "string.h"
  #include "conio.h"
  #pragma warning (disable: 4996)
  
  typedef struct item
  {
      char *pName;
      int Quantity, Price, Total;
  } ITEM;
  
  ITEM *Exam(char *pInput);
  
  int main()
  {
      ITEM *pItem;
      char input[81];
      printf("Type items: ");
      gets_s(input);
      char *pInput = input;
      pItem = Exam(pInput);
      printf("Name: %s\nQuantity: %d\nPrice: %d\nTotal: %d\n", pItem-&gt;pName, pItem-&gt;Quantity, pItem-&gt;Price, pItem-&gt;Total);
      free(pItem);
      return 0;
  }
  
  ITEM *Exam(char *pInput)
  {
      ITEM *pItem = (ITEM *)malloc(sizeof(ITEM));
      char *pNam, *pQuantity, *pPrice;
      int total, l, q, p;
      int qu, pr;
  
      for (l = 0; *(pInput + l) != ','; l++);
      pNam = (char *)malloc(l + 1);
      *(pInput + l) = '\0';
      strcpy(pNam, pInput);
      pItem-&gt;pName = pNam;
      *(pInput + l) = ',';
  
      for (q = 0; *(pInput + l + 2 + q) != ','; q++);
      pQuantity = (char *)malloc(q + 1);
      *(pInput + l + q + 2) = 0;
      strcpy(pQuantity, pInput + l + 2);
      qu = atoi(pQuantity);
      pItem-&gt;Quantity = qu;
  
      for (p = 0; *(pInput + l + q + 4) != ';' || *(pInput + l + q + 4) != 0; p++);
      pPrice = (char *)malloc(p + 1);
      *(pInput + l + q + 4) = 0;
      strcpy(pPrice, pInput + l + q + 4);
      pr = atoi(pPrice);
      pItem-&gt;Price = pr;
      pItem-&gt;Total = pr * qu;
      return pItem;
  }
  </code></pre>
  
  <p>input is 'shirt, 100, 5'. I want the output to be a structure of name, quantity, price and total. It let me type the input but when i press enter it doesn't return anything. The program just hangs...</p>