TiMe

Get this widget | Track details | eSnips Social DNA

ฟังวิทยุออนไลน์ ที่ izeemusic

ฟังวิทยุออนไลน์ ที่ izeemusic

วันเสาร์ที่ 27 มิถุนายน พ.ศ. 2552

DtS 2-24/6/52

วันนี้เรียนเรื่อง Arrayเป็นโครงสร้างข้อมูลที่เรียกว่า Linear List มีลักษณะคล้อยเซ็ต และการประกาศตัวปปรในภาษาคอมพิวเตอร์ส่วนใหญ่จะใช้ ภาษาปาสคาลและภาษาซี และได้รู้เดียวกับว่าชนิดของ อะเรย์ว่ามีอะไรบ้าง
Struture คือ โครงสร้างที่สมาชิกแต่ละตัวมีประเภทข้อมูลแตกต่างกันได้ โดยอาจมีสมาชิกเป็นจำนวณเต็ม จำนวณจริง ทศนิยม

ตัวอย่าง Structure 8 elemnt
เกี่ยวกับข้อมูลลูกค้าในการเข้าเล่นในร้าน InterNet_Cafe'


#include"stdio.h"
struct internetcafe
{
char name[10];
char sex[10];
int age;
int date;
int month;
int year;
int num;
float start;
float stop;
}net_c;
void input_data()
{
printf("Internet Customer\n");
printf("Name :");
scanf("%s",&net_c.name);
printf("Sex: ");
scanf("%s",&net_c.sex);
printf("Age: ");
scanf("%d",&net_c.age);
printf("Date/Month/Year :");
scanf("%d/%d/%d",&net_c.date,&net_c.month,&net_c.year);
printf("Computer Number is you play :");
scanf("%d",&net_c.num);
printf("Start Game :");
scanf("%f",&net_c.start);
printf("Stop Game :");
scanf("%f",&net_c.stop);
}
void show_data()
{
printf("\n\nData you\n");
printf("Name is %s\n",net_c.name);
printf("Sex is %s\n",net_c.sex);
printf("Age is %d\n",net_c.age);
printf("Date %d - %d - %d\n",net_c.date,net_c.month,net_c.year);
printf("Computer Number is %d\n",net_c.num);
printf("Start Game is %.2f\n",net_c.start);
printf("Stop Game is %.2f\n",net_c.stop);
printf("Thank You Customer so cute!!");
}
main()
{
input_data();
show_data();
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น