/in/foo.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
/in/foo.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
/in/foo.c: In function 'main':
/in/foo.c:9:3: error: unknown type name 'bool'
9 | bool flag = 1;
| ^~~~
/in/foo.c:10:13: error: 'new' undeclared (first use in this function)
10 | int* p1 = new int[n] {};
| ^~~
/in/foo.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:10:17: error: expected ',' or ';' before 'int'
10 | int* p1 = new int[n] {};
| ^~~
/in/foo.c:11:17: error: expected ',' or ';' before 'int'
11 | int* p2 = new int[n-1] {};
| ^~~
/in/foo.c:16:16: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
16 | p2[i - 1] = abs(p1[i] - p1[i - 1]);
| ^~~
/in/foo.c:36:3: error: 'delete' undeclared (first use in this function)
36 | delete[]p1; p1 = NULL;
| ^~~~~~
/in/foo.c:36:10: error: expected expression before ']' token
36 | delete[]p1; p1 = NULL;
| ^
/in/foo.c:37:10: error: expected expression before ']' token
37 | delete[]p2; p2 = NULL;
| ^
/in/foo.c:12:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
12 | scanf("%d", &p1[0]);
| ^~~~~~~~~~~~~~~~~~~
/in/foo.c:15:4: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
15 | scanf("%d", &p1[i]);
| ^~~~~~~~~~~~~~~~~~~