#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
using namespace std;
class Fichero {
private:
char fichero[156];
public:
char* setFichero(char _fichero[156]) {
strcpy(fichero, _fichero);
}
char* getFichero() {
return fichero;
}
} okia;
int main() {
char nameof[156];
cin >> nameof;
okia.setFichero(nameof);
string finalname = okia.getFichero();
finalname.append("nop.desktop");
cout << finalname;
ofstream finalName(finalname,ios::app);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGZzdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjbGFzcyBGaWNoZXJvIHsKICAgICAgICBwcml2YXRlOgogICAgICAgIGNoYXIgZmljaGVyb1sxNTZdOwogICAgICAgIHB1YmxpYzoKICAgICAgICBjaGFyKiBzZXRGaWNoZXJvKGNoYXIgX2ZpY2hlcm9bMTU2XSkgewogICAgICAgICAgICBzdHJjcHkoZmljaGVybywgX2ZpY2hlcm8pOwogICAgICAgIH0KICAgICAgICBjaGFyKiBnZXRGaWNoZXJvKCkgewogICAgICAgICAgICByZXR1cm4gZmljaGVybzsKICAgICAgICB9CiAgICAgICAgCiAgICB9IG9raWE7CgppbnQgbWFpbigpIHsKICAgICAgICAKICAgICAgICBjaGFyIG5hbWVvZlsxNTZdOwogICAgICAgIGNpbiA+PiBuYW1lb2Y7CiAgICAgICAgCiAgICAgICAgb2tpYS5zZXRGaWNoZXJvKG5hbWVvZik7CiAgICAgICAgc3RyaW5nIGZpbmFsbmFtZSA9IG9raWEuZ2V0RmljaGVybygpOwogICAgICAgIGZpbmFsbmFtZS5hcHBlbmQoIm5vcC5kZXNrdG9wIik7CiAgICAgICAgY291dCA8PCBmaW5hbG5hbWU7CiAgICAgICAgb2ZzdHJlYW0gZmluYWxOYW1lKGZpbmFsbmFtZSxpb3M6OmFwcCk7CiAgICAgICAgcmV0dXJuIDA7Cn0K
prog.cpp: In member function ‘char* Fichero::setFichero(char*)’:
prog.cpp:13:9: warning: no return statement in function returning non-void [-Wreturn-type]
prog.cpp: In function ‘int main()’:
prog.cpp:29:46: error: no matching function for call to ‘std::basic_ofstream<char>::basic_ofstream(std::string&, const openmode&)’
prog.cpp:29:46: note: candidates are:
In file included from prog.cpp:4:0:
/usr/include/c++/4.7/fstream:629:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
/usr/include/c++/4.7/fstream:629:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/4.7/fstream:614:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]
/usr/include/c++/4.7/fstream:614:7: note: candidate expects 0 arguments, 2 provided
/usr/include/c++/4.7/fstream:588:11: note: std::basic_ofstream<char>::basic_ofstream(const std::basic_ofstream<char>&)
/usr/include/c++/4.7/fstream:588:11: note: candidate expects 1 argument, 2 provided