Manh Cuong <[EMAIL PROTECTED]> wrote:
Vi` stdin va^~n co`n chua string thu+' 2, 3 trong buffer cho du` du`ng fflush. Cho ne^n ngay sau khi go.i ha`m scanf la^`n thu+' 2 thi` string trong buffer stdin do' ngay la^.p tu+'c duoc ga'n cho bie^'n str. Cho ne^n trong truong hop nay, le^.nh scanf da~ duoc thuc hien roi , chu ko phai la` chi? thuc hie^n duoc 1 la^`n.
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]>
Get your email and more, right on the new Yahoo.com
------------------------------------------------------------------------- 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