掃描字符串下面是結構的c代碼。在這個程序中,同時掃描名稱程序的價值正在從這一點終止。並且它還需要2個值作爲名稱數組。它沒有給出任何運行時錯誤或警告。 u能告訴我什麼是這個節目對我的電子郵件ID ....
使用結構
#include<stdio.h>
#include<conio.h>
struct student
{
int id;
char name[20];
float per;
} st;
main()
{
clrscr();
printf("\nenter the info of student");
printf("\n=======================\n");
printf("id:");
scanf("%d:",&st.id);
printf("name :");
scanf("%s :",st.name);
printf("per :");
scanf("%f :",&st.per);
printf("\n id is: %d \n",st.id) ;
printf("\n name is: %s \n",st.name) ;
printf("\n per is: %1f \n",st.per) ;
getch();
return 0;
}
這是一個質量保證網站; 「請快速回答」和電子郵件ID無用 – sehe
請提供您嘗試輸入的姓名的長度。它是超過19個字符?請考慮重寫您的問題,使其更具可讀性。 –