ช่วยหน่อยครับ ไม่รู้ผิดตรงไหน
#include <stdio.h> #include <conio.h> #define SIZE 2
struct Myfriend { char name[15] ; char nickname[10]; short int age; char email[25]; } fr[SIZE];
void input(int rec); //function prototype void report(void); //function prototype void line(void); //function prototype
int main() { int i; /* data entry */ for(i = 0; i < SIZE; i++) input(i); /* wait and clear screen before and print report */ printf("Press any key . . ."); getch(); report(); }
void input(int rec) { printf("Name.......: "); gets(fr[rec].name); printf("Nickname.......: "); gets(fr[rec].nickname); printf("Age.......: "); scanf("%u", &fr[rec].age); fflush(stdin); // clear newline printf("Email.......: "); gets(fr[rec].email); printf("***********************"); printf("\n"); } void report(void) { printf("\n\t << F R I E N D S H I P >>\n"); line(); printf("Seq. Name Nickname Age e-mail\n"); line(); for(int x = 0; x < SIZE; x++) printf("%2d. %-20s %-10s %2u %-25s\n,x+1, fr[x].name, fr[x].nickname,fr[x].age, fr[x].email"); line(); printf("\n"); }
void line(void) // print line { for(int i=1; i<= 62; i++) printf("-"); printf("\n"); } คือผมทำ โปรเจ็ค เกี่ยวกับ Find ship อะคับ มันรับค่า ชื่อ name nickname age email ได้ แต่ มันไม่แสดงผล ออกมา อะคับ รบกวน ที่นะคับ ว่า ผิดตรงไหน ขอบคุณล่วงหน้าคับ
|