Manh Cuong <[EMAIL PROTECTED]> wrote:
Theo toi thi co the lam nhu sau:
Thay lenh scanf bang lenh fgets:
printf("Enter some words: ");
scanf("%s", str);
->
fgets(str,80,stdin)
sau do' xu ly chuoi str.
Manh Cuong.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Nguyen
Sent: Tuesday, September 12, 2006 12:12 PM
To: vietlug-users@lists.sourceforge.net
Subject: Re: [Vietlug] day la doan text tui dinh gui len
On 5:50:50 am 09/11/06 hong pham <[EMAIL PROTECTED]> wrote:
>
>
> Stay in the know. Pulse on the new Yahoo.com. Check it
out.
Gu+?i la.i du`m Hong Pham
Mình vừa gặp phải má»t lá»i rất khó hiá»u. Äây là Äoạn
mã nguá»n cá»§a mình:
#include "stdio.h"
int main()
{
char str[80];
printf("Enter some words: ");
scanf("%s", str);
printf("The first word you entered is : %s\n", str );
printf("Enter some words: ");
scanf("%s", str);
printf("The first word you entered is : %s\n", str );
return 0;
}
và Äây là kết quả mà mình mong Äợi:
"Enter some words:hello word
The first word you entered is:hello
Enter some words:who are u?
The first word you entered is:who"
nhưng kết quả mà mình thu ÄÆ°á»£c lại là :
"Enter some words: hello word
The first word you entered is : hello
Enter some words: The first word you entered is : word"
Không thá» hiá»u ná»i tại sao hà m scanf() lại chá» hoạt Äá»ng
Äúng má»t lần. Ngay cả khi mình Äã sá» dụng hà m fflush(stdin)
nhưng kết quả vẫn như cÅ©. Ai Äó giúp mình vá»i. Mình xin
cám ơn!!!
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
VietLUG-users mailing list
VietLUG-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vietlug-users
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
VietLUG-users mailing list
VietLUG-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vietlug-users
[EMAIL PROTECTED]>
All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ VietLUG-users mailing list VietLUG-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vietlug-users