!22497 [MS][LITE][Develop] fix c++ example for vs

Merge pull request !22497 from sunsuodong/fix_vs_run
This commit is contained in:
i-robot 2021-08-28 01:27:48 +00:00 committed by Gitee
commit a264e361c2
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ char *ReadFile(const char *file, size_t *size) {
return nullptr;
}
std::ifstream ifs(file);
std::ifstream ifs(file, std::ifstream::in | std::ifstream::binary);
if (!ifs.good()) {
std::cerr << "file: " << file << " is not exist." << std::endl;
return nullptr;

View File

@ -60,7 +60,7 @@ char *ReadFile(const char *file, size_t *size) {
return nullptr;
}
std::ifstream ifs(file);
std::ifstream ifs(file, std::ifstream::in | std::ifstream::binary);
if (!ifs.good()) {
std::cerr << "file: " << file << " is not exist." << std::endl;
return nullptr;