資源簡介
面向用戶會員,用了c++的文件處理,是初學者的最佳選擇。
代碼片段和文件信息
#include
#include
#include
#include
#include“windows.h“;
using?namespace?std;
int?sum;
SYSTEMTIME?st;
int?yearmonthday;
char?*path_1?=?“f:\\memberinfo.txt“;
char?*path_2?=?“f:\\accountbookinfo.txt“;
char?*path_3?=?“f:\\membercardinfo.txt“;
char?*path_4?=?“f:\\sum.txt“;
class?MemberCard_list;
class?MemberCard
{
friend?class?MemberCard_List;
private:
double?rmb;
double?rech;
double?cons;
int?id;
char?*?name;
int?password;
int?tel;
MemberCard?*next;
public:
MemberCard():rmb(0)rech(0)cons(0)id(sum++)password(rand()%123456)tel(rand()%99999)next(NULL)
{
name?=?new?char[5];
for(int?i?=?0;i?5;i++)
{
name[i]?=?‘A‘?+?rand()%26;
}
name[5]?=?‘\0‘;
}
void?Recharge()
{
int?temp?=?ran
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????3948??2013-05-08?14:55??test1.cpp
- 上一篇:c語言貪心算法
- 下一篇:Strassen矩陣相乘算法,C++實現,可運行
評論
共有 條評論