i need to get this code debugged ....
thank you in advance..
Code:
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
class str
{
public:
char s[100];
str()
{;}
str(char *ch)
{
strcpy(s,ch);
}
void concat(x,y)
{
s=strcat(x,y);
}
void showdata(ch)
{
puts(ch);
}
void getdata()
{
cout<<"\nEnter the string:";
gets(s);
}
};
void main()
{
clrscr();
char a[100],b[100],ch[100];
cout<<"\n\t\t\tCreating an uninitialised object";
str c,c2;
puts(c.s);
cout<<"\n\t\t\tCreating an object with string constants";
str c1("Hello World");
puts(c1.s);
cout<<"\nEnter two strings:";
gets(a);
gets(b);
c2.s=c2.concat(a,b);
cout<<"\nEnter a string to be displayed:";
gets(ch);
c.showdata(ch);
getche();
}