Sometimes there is no problem with the logic of the code, and it can even run through in another IDE, but it just doesn’t work in Visual Studio. Next, we will solve this problem
Let's go to the console to see if this error is reported
If yes, just add the following line of code at the beginning of the file to run normally
#pragma warning(disable : 4996)