Big Project, Again !

After Polynomials (See my topics list), I got involved in a big project again.
I made this project myself,and try to use everything I learnt so far.

Please help me along the work,so I can finish and step into Windows Programming.

I need help from various programmers,so feel free to comment and don't worry about hijacking.

This project is about Making a Company's User and Staff System.

In order to revise : I made Customer class using all C techniques. And for the staff (Admin is a derived from Staff) using all about C++.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#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

If I have a setter,how could it be ?

password = "abcsjadas" I feel strange with this.
Last edited on
See my topics list
¿How?
You need to reserve enough space to store what you want. And to copy a c-string use strcpy
¿Why you don't want std::string?
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] ?

Now ok,I'll send another question if occured.
I'm not so familiar with C yet,so please be patient,I can write this in C++ not C.

Just this class uses C,other I'll use C++,just to understand its ancestor.

The class Customer (C only) again :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	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:
	};



===Other question


my servInfo.txt :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
########################################
#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);
		else if(isalpha(ch))
		{
			//I'm working on this.
		}
	}while(!feof(fin));


If you spot anything wrong,plz say sth.I'm continuing writing this.
Last edited on
Topic archived. No new replies allowed.