Language: C++

#include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int trace(int a(),int n){
    for(int i=0;i<n;i++){
        if(i>0) cout << " " << a[i];
    }
    cout << endl;
}

int insertionsort(int a(),int n){
    int j,v;
    for(int i=1;i<n;i++){
        v=a[i];
        j=i-1;
        while(j>=0&&a[j]>v){
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=v;
        trace(a,n);
    }
}

int main(){
    int n,i,j;
    vector<int> a(n);
    cin >> n;
    for(int i=0;i<n;i++) cin >> a[i];
    trace(a,n);
    insertionsort(a,n);
    return 0;
}



Compiler output:
a.cc: In function 'int trace(int (*)(), int)':
a.cc:10:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   10 |         if(i>0) cout << " " << a[i];
      |                                   ^
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int insertionsort(int (*)(), int)':
a.cc:18:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |         v=a[i];
      |              ^
a.cc:18:14: error: invalid conversion from 'int (*)()' to 'int' [-fpermissive]
   18 |         v=a[i];
      |           ~~~^
      |              |
      |              int (*)()
a.cc:20:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   20 |         while(j>=0&&a[j]>v){
      |                        ^
a.cc:20:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         while(j>=0&&a[j]>v){
      |                     ~~~~^~
a.cc:21:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |             a[j+1]=a[j];
      |                  ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:21:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |             a[j+1]=a[j];
      |                       ^
a.cc:21:19: error: assignment of read-only location '*(a + (((sizetype)j) + 1))'
   21 |             a[j+1]=a[j];
      |             ~~~~~~^~~~~
a.cc:24:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |         a[j+1]=v;
      |              ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:24:15: error: assignment of read-only location '*(a + (((sizetype)j) + 1))'
   24 |         a[j+1]=v;
      |         ~~~~~~^~
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
a.cc: In function 'int main()':
a.cc:34:11: error: cannot convert 'std::vector<int>' to 'int (*)()'
   34 |     trace(a,n);
      |           ^
      |           |
      |           std::vector<int>
a.cc:8:15: note:   initializing argument 1 of 'int trace(int (*)(), int)'
    8 | int trace(int a(),int n){
      |           ~~~~^~~
a.cc:35:19: error: cannot convert 'std::vector<int>' to 'int (*)()'
   35 |     insertionsort(a,n);
      |                   ^
      |                   |
      |                   std::vector<int>
a.cc:15:23: note:   initializing argument 1 of 'int insertionsort(int (*)(), int)'
   15 | int insertionsort(int a(),int n){
      |                   ~~~~^~~