OOCP2_5

//BCA Support //www.bcasupport.xyz #include <iostream.h> #include <conio.h> #include <string.h> class String { char ch[10]; public: String(){} String(char *c) { strcpy(ch,c); } String(String &x) { strcpy(ch,x.ch); } void display() { cout<<"\nText = "<<ch; } }; int main() { clrscr(); String obj1("Hello"); obj1.display(); String obj2(obj1); obj2.display(); getch(); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.