Problem swapsort
User YH
Submission Time 2024-02-01 19:34:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swapsort.cpp: In function ‘bool checkSorted(int)’:
swapsort.cpp:7:10: error: invalid types ‘int[int]’ for array subscript
7 | if (p[e] > p[e+1]) {
| ^
swapsort.cpp:7:19: error: invalid types ‘int[int]’ for array subscript
7 | if (p[e] > p[e+1]) {
| ^
swapsort.cpp: In function ‘int main()’:
swapsort.cpp:39:19: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive]
39 | if (checkSorted(p)==true) {
| ^
| |
| int*
swapsort.cpp:4:22: note: initializing argument 1 of ‘bool checkSorted(int)’
4 | bool checkSorted(int p) {
| ~~~~^