Answer the question
In order to leave comments, you need to log in
Why does it return ELF?
Hello!
Please help
This code:
std::string youString(youTrue);
std::ifstream ss(youString);;
if(!ss.is_open()) {
throw std::runtime_error("Такого файла не существует");
}
char buff[50];
ss >> buff; // считали первое слово из файла
std::cout << buff << std::endl; // напечатали это слово
// Возвращает ELF
ss.close(); // закрываем файл
return "0";
}
Answer the question
In order to leave comments, you need to log in
Output a variable with the name of the file to the console. Because it feels like you specify the file through the command line argument, and then you open for reading not the file, but the executable file itself.
Well, it's better to open it in text form, and not in binary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question