title: warning: passing arg 1 of `atoi' makes pointer from integer without a cast
body: <p>I am learning C language one year and it is my first time that I got that warning. <strong>This is my code:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;winsock2.h&gt;
  #include &lt;windows.h&gt;   
  #include &lt;string.h&gt;
  
  
   int socket_creation(FILE* fp){
          int s;
          s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
          if (s == INVALID_SOCKET){
                  printf("Error occurred while creating socket: %d\n", WSAGetLastError());
                  fprintf(fp, "Error occurred while creating socket: %d\n", WSAGetLastError());
          }
          else{
                  printf("Socket creation was successful.\n");
                  fprintf(fp, "Socket creation was successful.\n");
          }
          return s;
  }
  
  
  void connect_to_server(int s, struct sockaddr_in ClientService, FILE* fp){
          int cResult;
          cResult = connect(s, (struct sockaddr*) &amp;ClientService, sizeof(ClientService));
          if (cResult == SOCKET_ERROR){
                  printf("connection to the server has been failed: %d\n", WSAGetLastError());
                  fprintf(fp, "connection to the server has been failed: %d\n", WSAGetLastError());
                  cResult = closesocket(s);
                  if (cResult == SOCKET_ERROR){
                          printf("error occurred while trying to close socket. \n");
                          fprintf(fp, "error occurred while trying to close socket. \n");
                  }
                  WSACleanup();
          }
          else{
                  printf("Connection to serevr has been made successfully. \n");
                  fprintf(fp, "Connection to serevr has been made successfully. \n");
          }
  }
  
  int send_to_serv(char buffer[], int s){
          int sendto;
          sendto = send(s, buffer, 1024, 0);
          if (sendto == -1)
                  printf("\nError: couldn't send the Code.\n", buffer);
          else printf("\nCode: &lt;%s&gt; SENT.\n", buffer);
          return sendto;
  }
  
  int recv_from_serv(int s, int* numberLines, FILE *fp){
  
          int recvfrom;
          char buffer[1024] = "";
  
          recvfrom = recv(s, buffer, 1024, 0);
          if (recvfrom == -1)
          printf("\nError: couldn't receive Code. !\n");
          else printf("\nRespond: &lt;%s&gt;, RECEIVED. \n", buffer);
          fprintf(fp, "\n");
          fprintf(fp, buffer);
  
          *numberLines = atoi(buffer + 3);
          return recvfrom;
  }
  
  int main() {
  
          WSADATA info;
          int error, s;
          int sResults, sendError, recvError,convert2;
          char buffer[1024] = "";
          char recvbuf[1024] = "";
          int numberLines, i, temp, convert;
          char converted_num[1024] = "";
          struct sockaddr_in ClientService;
          FILE *fp = fopen("stored_data.txt", "w");
          char **lines_array = NULL;
          error = WSAStartup(MAKEWORD(2, 0), &amp;info);
  
          if (error != 0){
                  printf("WSAstartup failed with error: %d\n", error);
                  exit(1);
          }
  
          s = socket_creation(fp);
  
          ClientService.sin_family = AF_INET;
          ClientService.sin_addr.s_addr = inet_addr("54.209.143.42");
          ClientService.sin_port = htons(6714);
  
          connect_to_server(s, ClientService, fp);
  
          strcpy(buffer, "100");
          sendError = send_to_serv(buffer, s);
          recvError = recv_from_serv(s, &amp;numberLines, fp);
  
          strcpy(buffer, "400");
          sendError = send_to_serv(buffer, s);
          recvError = recv_from_serv(s, &amp;numberLines, fp);
          printf("\nNumber of Lines are: %d\n", numberLines);
  
          lines_array = malloc(sizeof(char*)*numberLines);
          temp = numberLines;
  
          for (i = 0; i &lt; temp; i++){
                  convert = 5000001 + i;
                  _itoa(convert, converted_num, 10);
                  sendError = send_to_serv(converted_num, s);
                  convert2=atoi(convert);
                  convert=convert%10000;
                  if(convert2==0) {
                          for(i=0; i&lt;=1024; i++) {
                                  buffer[i]=0;
                          }
                          lines_array= (convert);
                          recv_from_serv(s, &amp;numberLines, fp);
                  }
                  else{
                          for(i=0; i&lt;=1024; i++) {
                                  buffer[i]=0;
                                  fprintf(fp, "\n");
                                  fprintf(fp, buffer);
                          }
                  }
          }
  
          close(fp);
          system("PAUSE");
          return 0;
   }
  </code></pre>
  
  <p><strong>Output:</strong>
      finalproject1.c:110: warning: passing arg 1 of `atoi' makes pointer from integer without a cast</p>
  
  <p>It's mean that I have problem with row number 110:</p>
  
  <pre><code>convert2=atoi(convert);
  </code></pre>