#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
이 코드는 도움이 필요합니다. 내 컴파일러는 계속 -fpermissive 옵션을 사용하도록 요청하지만 계속 입력 할 위치를 모르겠습니다. 아래의 코드와 표시된 오류를 붙여 넣었습니다.- 코드 블럭의 허용 옵션. 그 "수감자"옵션은 어디에 두어야합니까?
using namespace std;
int cx = 0, cy = 0;
double x =0, y=0, r = 5;
int main(){
ofstream myfile;
myfile.open("dingo.txt");
for(int g =0 ; g <= 360; g++)
//find x and y
//Get points of a circle.
x = cx + r * cos(g);
y = cy + r * sin(g);
//This is what pops up below:
//In function int main()':
//Error: name lookup of 'g' changed for ISO 'for' scoping [-fpermissive]
//note: (if you use '-fpermissive' G++ will accept your code)
//where should I enter the required option?
myfile << "X: " << x << "; Y: " << y <<endl;
myfile.close();
return 0;
}
'-fpermissive'를 사용하면 안됩니다. 대신 코드에서 오류를 수정해야합니다. –
왜 코드를 고치는 대신'-fpermissive'를 사용하고 싶습니까? –
'-fpermissive'를 사용했다하더라도, 코드는 여러분이 원하는대로하지 않을 것입니다. – hvd