yeah it does :)
and how stupid the compiler is, it didn't mention the error:D
thanks that you told me
NOW it's almost 70% done
i am gonna right the friend function now
please tell me its declaration and how to right the prototype and how to call from the main()
i am waiting
in doing friend function, i am having a serious trouble:(
Avast is terminating it each time i run it, there is no compilation error, but avast says there is some thing suspicious in it, and terminates it :(
i am just putting spending as a parameter
please help
dear brother:)
my code is almost 90% done now
and i am so glad to see it running
but there is a problem again, as you know i had to declare 3 constructors, you told me how to declare default constructor then parametrized and then the one which will take user inputs
i am facing the problem here, when i declared the 3rd object using new operator it calls the by default constructor first , i wrote it as follows
customer *cptr;
cptr= new customer();
how should i write it??
should i pass the parameters??
please guide me
i am so near to complete it
regards
Please note that your assignment says the following:
In the main() function, create three customer type objects by using new operator. Initialize first object with default constructor, second with parameterized and take input from user for third object (use setter functions to set third object’s values taken from the user).
It doesn't say you have to use 3 types of constructors, you need 2 types of constructors and another object of which the values are set using the setter functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Customer * anonymous;
Customer * mark;
Customer * generic;
//default constructor, id=0, spent=0, name=No name
anonymous = new Customer();
//parameterized constructor, id=54, spent=8000, name=Mark
mark = new Customer(54, 8000, "Mark");
//default constructor, id=0, spent=0, name=No name
generic = new Customer();
generic->set_id(55); // id=55
generic->set_spent(9000); //spent=9000
generic->set_name("Tom"); //name=Tom
yes dear
i did exactly the same, but there was some error that terminates it while running, but output is as it was required :)
bundle bundle of thanks for your deep concern and help
really thanks
may ALLAH bless you and give you it's reward
regards
Assalam o alikum
yes there has been a logical error, that i was unable to understand, because i was running short of time and i had to submit it, so i stopped pondering over it :P
please tell me how can i upload my code here?
should i just copy paste here, or i can upload *.cpp file?
regards