#include <iostream>
using namespace std;
class MyClass
{
private :
char str[848];
public :
MyClass()
{
}
MyClass(char a[])
{
str[848] = a[848];
}
MyClass operator () (char a[])
{
str[848] = a[848];
}
void myFunction(MyClass m)
{
}
void display()
{
cout << str[848];
}
};
int main()
{
MyClass m1; //MyClass has just one data member i.e. character array named str of size X
//where X is a constant integer and have value equal to your last 3 digit of arid number
MyClass m2("COVID-19") , m3("Mid2020");
m2.display(); //will display COVID-19
cout<<endl;
m2.myFunction(m3);
m2.display(); //now it will display Mid2020
cout<<endl;
m3.display(); //now it will display COVID-19
//if your array size is even then you will add myEvenFn() in class with empty body else add myOddFn()
return 0;
}
我不能使用string
,因为我被告知不要,因此,我需要知道如何使它显示所需的输出