#include <iostream>
#include <cstring>
using namespace std;
class A {
public: char *str;
A(char s[20] = 0 ) {str=s;}
};
int main() {
char input[20];
cin >> input;
// char * to A
const A& a = static_cast<A>(input);
strcat(a.str, "-success");
cout << a.str;
return 0;
}
Thanks
Happy programming !
#include <cstring>
using namespace std;
class A {
public: char *str;
A(char s[20] = 0 ) {str=s;}
};
int main() {
char input[20];
cin >> input;
// char * to A
const A& a = static_cast<A>(input);
strcat(a.str, "-success");
cout << a.str;
return 0;
}
Thanks
Happy programming !
No comments:
Post a Comment