为啥printf比cout优先级高呀?
void search()
{
char name[40];
struct store *info;
printf("Please imput the name of goods:");//这里能先输出(先于gets(name);)
gets(name);
info=find(name);
if(!info)
cout<<"Cannot find!"
<<endl;
else
{
cout<<info->name
<<"\t\t"
<<info->pinpai
<<"\t\t"
<<info->chandi
<<"\t\t"
<<info->kucun
<<"\t\t"
<<info->dajia
<<endl;
}
}
void search()
{
char name[40];
struct store *info;
cout<<"Please imput the name of goods:";//这里不能要在整个循环结束后才输出
gets(name);
info=find(name);
if(!info)
cout<<"Cannot find!"
<<endl;
else
{
cout<<info->name
<<"\t\t"
<<info->pinpai
<<"\t\t"
<<info->chandi
<<"\t\t"
<<info->kucun
<<"\t\t"
<<info->dajia
<<endl;
}
}