Comparison between pointer and int is not valid

prog.cpp: In function ‘void insertionAtMiddle(node*&, int, int)’:
prog.cpp:72:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
while(temp<=(p-1))
^

hello @syed

we cant compare pointer and int .
becuase pointers contains addresses and int contains integer data
compiler will treat them differently hence u r getting this issue.

pls share ur code i will try to debug it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.