this program is inorder to split a string like krishnamoorthy into krishna & moorthy by splitting it at m
i tried the following coding.the compiler pointed out an error saying that for cannot be expanded inline.what shud i do to rectify the error?this
#include<iostream.h>
#include<string.h>
#include<conio.h>
class string
{
private:
char ch[20];
public:
void get()
{
cout<<"\nenter string";
cin>>ch;
}
void operator / (string s1)
{
int l;
l=strlen(s1.ch);
if(l%2==0)
{
s=l/2;
for(int i=0;i<s;i++)
{
cout<<ch[i];
}
}
else
{
s=(l+1)/2;
for(int i=0;i<s;i++)
{
cout<<ch[i];
}
}
}
void main()
{
string s1,s2;
s2.get();
s1/s2;
getch();
}