Tom Cooper on Fri, 2 Jun 2000 08:12:21 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

OT: C Programming question


Hi all,

A quick one,

I wrote the following C snippet :

#include <stdio.h>

main(){

  char name[9];

  printf("Username:");
  scanf("%s", &name);
  printf("\nHello, %s\n", &name);
  return(0);
}

My problem is, when I run it from a terminal, all works well,
however, if I want to run it via inetd, i.e. telnet xxxx 20000 there 
is no output until I enter something, then everything is output to 
the terminal and the telnet connection is closed.

Any C gurus to help me out?

Cheers,
Tommy