I'm learning C++ for my school. I' m using Visual studio to code C++, I'm trying to compile this code:
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
freopen("cd.inp", "r", stdin);
freopen("cd.out", "w", stdout);
int a, b;
while (true){
cin >> a >> b;
cout << a << ' ' << b;
break;
}
fclose(stdin);
fclose(stdout);
}
I've got these errors:
Severity Code Description Project File Line Suppression State Error C4996 'freopen': This function or variable may be unsafe. Consider using freopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. clock_degrees F:\CODING\C++\clock_degrees\clock_degrees\clock_degrees.cpp 11
Severity Code Description Project File Line Suppression State Warning C6031 Return value ignored: 'freopen'. clock_degrees F:\CODING\C++\clock_degrees\clock_degrees\clock_degrees.cpp 11
What should I do now? I've got some problems about scanf and printf instead of freopen too. I thought the problems'd come from <stdio.h> library.