#ifndef CUSTOMER_H
#define CUSTOMER_H
#include <cstring>
#include <iostream>
namespace Kudy
{
class Customer
{
private :
//Real Life Info,Customers Can Access !
char *fullname;
char *address;
char *telephone;
//System Info,Staff Can Access !
char *customerID;//Unique
char *username;//Format : First Word In Name + CustomerID
char *lastlogin;//Format : dd/mm/yyyy
int amountpaid;
//Private Information,Must Be Encrypted ! Can Only Be Changed By Customers.
char *password;
char *creditcard;
public:
protected:
};
}
#endif
Thanks all supporters.
First question is : If I want to store a C-String,did I do it right ? Use char* password
I should use all techniques available in one project Customer class uses C, Employee class uses C++ and Admin derived from Employee uses c++ too. Don't worry,how can I reserve space, maybe char a[30] ?
class Customer
{
private :
//Real Life Info,Customers Can Access !
char fullname[20];
char address[30];
char telephone[10];
//System Info,Staff Can Access !
char customerID[10];//Unique
char username[10];//Format : First Word In Name + CustomerID
char lastlogin[10];//Format : dd/mm/yyyy
int amountpaid;
//Private Information,Must Be Encrypted ! Can Only Be Changed By Customers.
char password[30];
char creditcard[30];
public:
Customer(){strcpy(customerID,getNewID()};
void changeInfo();
void viewInfo();
protected:
};
########################################
#Server Info :
#
#Don't Change Anything Here !
#No. Of Customer :
NOC 0
#No. Of Staff :
NOS 0
#No. Of Admin :
NOA 0
#Company's Avenue :
CA 0
#Company's Upkeep :
CU 0
#Company's Profit :
CP 0
#No. Of Login :
NOL 0
I want the program to find like find("servInfo.txt","NOC") to find the no. of customer.It discards when it saw '#' and when it found NOC, it returns the number after it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
FILE* fin;
char ch;
fin = fopen("servInfo.txt","r+");
do
{
ch = fgetc(fin);
if(ch = '#')
while(ch != '\n')
ch = fgetc(fin);
elseif(isalpha(ch))
{
//I'm working on this.
}
}while(!feof(fin));
If you spot anything wrong,plz say sth.I'm continuing writing this.