title: c programming error is expected ‘;’, ‘,’ or ‘)’ before string constant
body: <p>i use gcc to compile my programming,but see error in </p>
  
  <pre><code>void sendemail(char *stmpServer, char *serveruser, char *serverpassword);
  </code></pre>
  
  <blockquote>
    <p>In file included from test.c:11: sendmail.c:46: error: expected ‘;’,
    ‘,’ or ‘)’ before string constant sendmail.c:120: error: expected ‘;’,
    ‘,’ or ‘)’ before string constant</p>
  </blockquote>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/socket.h&gt;
  #include &lt;netinet/in.h&gt;
  #include &lt;errno.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;sys/time.h&gt;
  #include &lt;netdb.h&gt;
  
  #define stmpServer "smtp.exmail.qq.com"
  #define login_name "secbot@test.com"
  #define login_passwd "123456"
  #define mail_to "root@test.com"
  #define ip "127.0.0.1"
  
  
  
  int base64_encode(unsigned char *buf, int nLen, char *pOutBuf, int nBufSize);
  
  void sendemail(char *stmpServer, char *serveruser, char *serverpassword);
  </code></pre>
  
  <p>but i modify this</p>
  
  <pre><code>        const char * stmpServer = "smtp.exmail.qq.com";
          const char * login_name = "secbot@test.com";
          const char * login_passwd = "123456";
          const char * mail_to = "root@test.com";
          const char * ip = "127.0.0.1";
      ......
      void sendemail(char *stmpServer, char *serveruser, char *serverpassword);
  
  void sendemail(char *stmpServer, char *serveruser, char *serverpassword)
  {
      int sockfd = 0;
      struct sockaddr_in their_addr = {0};
      char buf[1500] = {0};
      char rbuf[1500] = {0};
      char login[128] = {0};
      char pass[128] = {0};
      struct hostent *host = NULL;
  
      if((host = gethostbyname(smtpServer))==NULL)
      {
          fprintf(stderr,"Gethostname error, %s\n", strerror(errno));
          exit(1);
      }
  </code></pre>
  
  <p>in the </p>
  
  <blockquote>
    <p>if((host = gethostbyname(smtpServer))==NULL)</p>
  </blockquote>
  
  <p>say </p>
  
  <blockquote>
    <p>sendmail.c:130: error: ‘smtpServer’ undeclared (first use in this
    function)</p>
  </blockquote>