title: input string through scanf
body: <p>i wanted to ask is there way to input blank in string through scanf,
  i am using this [^\n] to input what so ever excluding newline .is it correct ?but is creating lot of problem as it seems to be stored in the input buffer.what is the best way to input string .both gets and fgets are creating lot of problems,</p>
  
  <pre><code>        while(strcmp(buf,"quit"))
                 {    
              scanf("%*[^\n]",buf);
              n=send(connected,buf,strlen(buf),0);
              if(n&lt;0)
              {
              perror("send");
              printf("error sending");
              exit(1);
              }
              //printf("server has send\n");
              n=recv(connected,buf,100,0);
              if(n&lt;0)
              {
              perror("recv");
              printf("error recieving");
              exit(1);
              }
              //printf("waiting to recieve something\n");
              buf[n]='\0';
              printf("client:%s\n",buf);
          }
  </code></pre>
  
  <p>this is creating infinite loop the same thing is repeated again and again.</p>