วันเสาร์ที่ 15 สิงหาคม พ.ศ. 2552

DTS 07 11/08/2009

สรุปบทเรียน
วันนี้อาจารย์ให้ส่งสมุดจดการบ้านและส่งงานที่ส่งให้ทำงานกลุ่ม
อาจารย์ให้ไปอ่านเรื่องคิวเองเพราะนักศึกษาเสียงดังไม่มีมารยา
และเอาiostream
#include
#include
using namespace std;
int main()
{
char FirstName[30], LastName[30];
int Age;
char FileName[20];
/*
cout << "Enter First Name: ";
cin >> FirstName;
cout << "Enter Last Name: ";
cin >> LastName;
cout << "Enter Age: ";
cin >> Age;
cout << "\nEnter the name of the file you want to create: ";
cin >> FileName;
ofstream Students(FileName, ios::out);
Students << FirstName << "\n" << LastName << "\n" << Age;
*/
cout << "Enter the name of the file you want to open: ";
cin >> FileName;
ifstream Students(FileName);
Students >> FirstName >> LastName >> Age;
cout << "\nFirst Name: " << FirstName;
cout << "\nLast Name: " << LastName;
cout << "\nEnter Age: " << Age;
cout << "\n\n";
return 0;
}

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

ผู้ติดตาม