I am new to C++ language and I have no idea of pointers and their usage. I\'m facing the error \"[Error] invalid conversion from \'int\' to \'int*\' [-fpermissive]\"
Here midd(int arr[10],int size);
is expecting int* and you are trying to pass int value ( ax[10] which is also ERROR : ax has only 10 elements and you try to use 11th ), and compiler can not convert int
to int*
so it shows "[Error] invalid conversion from 'int' to 'int*' [-fpermissive]".
To make this program correct you have to make this change.
Replace cout<< midd (ax[10], asize );
with cout<< midd (ax, asize );
-now pointer of ax (int*
) is passed so midd()
will accept it.