Re: help with C program

1999-07-20 Thread Ariel Biener
On Tue, 20 Jul 1999, David FRYDMAN wrote: If your problem here is as follows: Enter a string, and then a char, then print the string, and then the char, where the delimiter between the string and the char may be '\n' or space (for example), i.e.: /run ABC D scanf accept ABC getchar accept D

Re: help with C program

1999-07-20 Thread David FRYDMAN
Your problem comes that after  scanf, the file pointer don't point at the end of stdin. it points to the first caracter scanf did not return (if you pressed "abc\n" your getchar will return '\n') you can solve the problem easely by adding     fseek(stdin,0,SEEK_END); before using getchar()   by t

Re: help with C program

1999-07-19 Thread Ben-Nes Michael
small eha ? ;-) Meidan Zemer wrote: Hi, I have a small C program wich i compile with GNU C Compiler 2.8.1 and 2.7. and i got the same result in both times. #include #include #include main() {  char str[10];  int num;  scanf("%s",str);  printf("scanf accept %s\n",str);  num=getchar();  printf("

Re: help with C program

1999-07-19 Thread Oleg Goldshmidt
And please try to post from valid addresses: [Sorry for the noise, fellows, but how else can I point it out to him? ;-) ] - The following addresses had permanent fatal errors - Meidan Zemer <[EMAIL PROTECTED]> - Transcript of session follows - .. while talking to q.inter

Re: help with C program

1999-07-19 Thread Oleg Goldshmidt
Meidan Zemer <[EMAIL PROTECTED]> writes: > I have a small C program wich i compile with GNU C Compiler 2.8.1 and > 2.7. This is not a linux question. It has nothing to do with linux. Next time please RTFM and then post to comp.lang.c. I am not sure what you are trying to do. You do not say what

Re: help with C program

1999-07-19 Thread Eugene L. Berman
Meidan Zemer wrote: > > For some reason "getchat()" accept Null string and do'nt prompt for > the user. > I run kernel 2.2.3 on pentium 120 with 32MG > I am sure it is somting simple but i just can'nt see it!! > Does anybody have any idea about it? Well, first of all...why not change settings

help with C program

1999-07-19 Thread Meidan Zemer
Hi, I have a small C program wich i compile with GNU C Compiler 2.8.1 and 2.7. and i got the same result in both times. #include #include #include main() {  char str[10];  int num;  scanf("%s",str);  printf("scanf accept %s\n",str);  num=getchar();  printf("getchar accept %c\n",num); } For som