I am using VS2008 and Win7 64bit.
#include <iostream>
#include "utils.h"
#include <string>
int main()
{
int gm = DETECT;
int gd = DETECT;
initgraph(&gm, &gd, "");
double x = 0;
double y = 0;
double r = 50;
for(int i=0 ; i<=360 ; i++)
{
x = r * cos(DegreeToRad((double)i));
y = r * sin(DegreeToRad((double)i));
PlotLine(0,0,x,y, YELLOW);
std::string str;
str.append(std::to_string(i));
str.append(". ");
str.append(std::to_string(0));
str.append(", ");
str.append(std::to_string(0));
str.append(") to (");
str.append(std::to_string(x));
str.append(", ");
str.append(std::to_string(y));
str.append("). m=");
str.append(std::to_string(Slope(0,0,x,y)));
str.append("\n");
if(i%90==0)
{
str.append("\ni=");
str.append(std::to_string(i));
str.append("\n");
}
WriteToFile("slope.txt", str.c_str());
}
getch();
closegraph();
return 0;
}
Error Messages.
1>e:\slope.test.cpp(21) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(21) : error C3861: 'to_string': identifier not found
1>e:\slope.test.cpp(23) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(23) : error C3861: 'to_string': identifier not found
1>e:\slope.test.cpp(25) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(25) : error C3861: 'to_string': identifier not found
1>e:\slope.test.cpp(27) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(27) : error C3861: 'to_string': identifier not found
1>e:\slope.test.cpp(29) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(29) : error C3861: 'to_string': identifier not found
1>e:\slope.test.cpp(31) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(31) : error C3861: 'to_string': identifier not found
1>e:\slope.test.cpp(37) : error C2039: 'to_string' : is not a member of 'std'
1>e:\slope.test.cpp(37) : error C3861: 'to_string': identifier not found
1>Generating Code...
1>Build log was saved at "file://e:\Debug\BuildLog.htm"
1>RasterizationLineCircleEllipse - 15 error(s), 14 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========