If you want to store a phone number, then declare your variable as "Phone_Number"!
"as shown here": We can only read so much code to try to understand what you are doing. We can't read your mind.
Printable View
Yes that is true,
So i hope to change that variable to make it for generating an ID. i don't want any more "Phone number" Generating the Auto ID is more important than Phone number.
So now the program shouldn't ask for entering the ID, directly when the patient is successfully added the Auto ID should appear with the entered information.
for example:
First Name:
John
Last Name:
Jobs
ID:
001
Regards
So why not just go to the end of your queue, or what ever your container is, look up the last ID and add 1 to it?
Does this data need to be persistent between runs of the program?
Hey,
How can i do that?
Is your idea, the number will be auto increase when i added another patient?
If yes, Please where do i have to change in my code.
I just need the ID to be increasing when i added another patient
like the first patient will have ID number 1
the second patient will have number 2.........
So i don't want the the program to ask me for Entering ID.
But when i add it. he should have the ID.
Thanks
Hey,
I have added
Code:
int main(){
int Auto_ID =0;
}
than Added
Code:
cout<<"ID"<<p.Auto_ID++<<endl;
but it showing me an error
Code:"see declaration of 'main'"
I just need the easiest way to make this ID works
Thanks
hey, it is a pointer
Code:// define class for queue
class queue
{
public:
queue (void);
int RegisterPatien (patient p);
int RegisterPatientAtBeginning (patient p);
patient GetNextPatient (void);
int CancelAll (patient * p);
void OutputList (void);
char DepartmentName[50];
private:
int ShowAllPatient;
patient List[MAXPATIENTS];
};
So what is the problem with:
Is there any other method to do auto-increment number?Code:
int main(){
int Auto_ID =0;
}
HI friends I'm actually new to C++..and wanted to know how to add a auto numbering code to my First ever program..guys would you mind helping me..how should this be coded?
What is "a auto numbering code"?
What is it supposed to do?
Well its suppose to increase the number..example: 1st Customer ID would be Cust001, 2nd Customer Id would be Cust002..
actually this is for a Bank and when a new member is added his/her Bank Number should be delivered automatically..example:
Account Number: 001 //this should be automatically generated
Name : J_Freak //the person has to type
Age : 21 //the person has to type
so on....
If it "or a Bank" then you should (maybe just must!) use some type of database. And a database will generate all these IDs for you for each new added account.
Well this is really really a basic "BASIC" programming..just a console application with 4 options (New account, Withdraw, Deposit & Balance inquiry) and some basic validations..so when the "New account" is selected the user must be able to fill the application..and the account number should be generated automatically..and the details will be saved in a notepad..
Account Number: 001 //this should be automatically generated
Name : J_Freak //the person has to type
Age : 21 //the person has to type
So..I actually need to know how to do this "auto numbering" thinggy...
Are you going to supply such a "a basic "BASIC" ... console application with 4 options" to some Bank?
As for "auto numbering" in a real application (not just a a basic "BASIC" one) - see my previous post.
Nah nah..just a basic program for my school project..:)