foo.c:2:1: error: unknown type name 'using'
using namespace std;
^
foo.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
using namespace std;
^
foo.c:3:1: warning: return type defaults to 'int' [-Wreturn-type]
main(){
^
foo.c: In function 'main':
foo.c:4:1: error: stray '\243' in program
const float pi=3.1415926;
^
foo.c:4:1: error: stray '\273' in program
foo.c:5:1: error: expected ',' or ';' before 'int'
int n,i;
^
foo.c:7:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
scanf ("%d",&n);
^
foo.c:8:14: error: 'r' undeclared (first use in this function)
scanf ("%f",&r);
^
foo.c:8:14: note: each undeclared identifier is reported only once for each function it appears in
foo.c:9:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
struct point s{
^
foo.c:11:7: warning: unused variable 'y' [-Wunused-variable]
float y;
^
foo.c:10:7: warning: unused variable 'x' [-Wunused-variable]
float x;
^
foo.c:12:2: error: 'a' undeclared (first use in this function)
}a[100];
^
foo.c:13:5: error: 'i' undeclared (first use in this function)
for(i=0;i<n;i++)
^
foo.c:13:11: error: 'n' undeclared (first use in this function)
for(i=0;i<n;i++)
^
foo.c:19:1: error: 'S' undeclared (first use in this function)
S+=sqrt((a[i].x-a.x)*(a[i].y-a.y));
^
foo.c:19:1: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
foo.c:19:4: warning: incompatible implicit declaration of built-in function 'sqrt'
S+=sqrt((a[i].x-a.x)*(a[i].y-a.y));
^
foo.c:22:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^