由于我制作 3ds 自制程序是为了好玩,因此其中一些代码对您来说可能看起来很陌生,但它本质上是相同的,但您可以输入额外的代码行。我正在尝试在单独的文件夹中读取一个名为 about.txt 的文件。当我把它放在同一个文件夹中时,我让它工作了,但我丢失了那个文件,然后我的伙伴说他想要它Scratch3ds-master\assets\english\text
而不是Scratch3ds-master\source
我不断收到我编码的错误。我是堆栈溢出的新手,所以这可能是代码太多,但这里是代码:
#include <fstream>
#include <string>
#include <iostream>
int main()
{
// Initialize the services
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
int version_major;
int version_minor;
int version_patch;
version_major = 0;
version_minor = 0;
version_patch = 2;
printf("This is the placeholder for Scratch3ds\n\n");
std::ifstream about_file;
about_file.open("../assets/english/text/about.txt");
if (about_file.fail())
{
std::cerr << "file has failed to load\n";
exit(1);
}