Answer the question
In order to leave comments, you need to log in
How to allow Russian letters on the file path?
I write a function to check the existence of a file:
#include <Windows.h>
#include <stdio.h>
#include <sys/stat.h> // fastest way to get file existens
#define MAX_NAME 255
using namespace std;
int main()
{
findPath:
printf("Enter path \n");
wchar_t targetPath[MAX_NAME];
fgetws(targetPath, MAX_NAME, stdin);
struct _stat buffer;
if (_wstat(targetPath, &buffer) == 0) { // fastest way to get file existens //!breakpoint here
wprintf(L"file %s opened succesfull \n", targetPath);
}
else {
wprintf(L"No file like %s found, try again \n", targetPath);
goto findPath;
}
}
L"C:\Users\Admin\Desktop\folder @$%\test.txt\n"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question