Write a program in C to show use of differ constructors in a class.
Answers
Answered by
0
Constructor has the same name as that of the class and it does not have any return type. Also, the constructor is always public.
... .. ... class temporary { private: int x; float y; public: // Constructor temporary(): x(5), y(5.5) { // Body of constructor } ... .. ... }; int main() { Temporary t1; ... .. ... }
thanks
hope you like it
please mark as a brainliest answer
... .. ... class temporary { private: int x; float y; public: // Constructor temporary(): x(5), y(5.5) { // Body of constructor } ... .. ... }; int main() { Temporary t1; ... .. ... }
thanks
hope you like it
please mark as a brainliest answer
anish1801:
thats the question! can you help me writing the programme?
Similar questions
India Languages,
7 months ago
Math,
7 months ago
Math,
7 months ago
Computer Science,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago