0

Can someone tell me the program in c++ in which whenever we register the patient.....their id is generated automatically

c++

28th Feb 2017, 12:37 AM
prateek verma
prateek verma - avatar
3 Respostas
0
there isnt one specific program... but you could create a private static member of the class, key. everytime someone creates an object of that class (constructor is called) this objects ID is set to the key then the key is incremented. this key must be initialized to zero prior but this should work. the only spot that this variable is changed is in the constuctor. This forces every id tk be unique
28th Feb 2017, 6:45 AM
Michael Szczepanski
Michael Szczepanski - avatar
0
actually I don't know how to create member.... sorry to bother you.... but can you send me the syntax plz
1st Mar 2017, 1:54 PM
prateek verma
prateek verma - avatar
0
no need..... I got it... thanks
1st Mar 2017, 2:33 PM
prateek verma
prateek verma - avatar