• C

Function differs in levels of indirection from... Error.

I asked a question yesterday about one of my search function not working correctly. I got the answer and it seems to work, however when I try to compile, I get an error "error C2040: 'Search' : 'PtrModel (PtrModel,char *)' differs in levels of indirection from 'int ()'" I have no idea on how to fix it, so if someone already saw this message, I would like some help please !

PtrModel Search(PtrModel list, char* val)
     PtrModel CurPtr = list;
          if(CurPtr->modelName == val)
               return CurPtr;
          CurPtr = CurPtr->next;
     return 0;

Thanks, Frank
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Could you post the code before that snippet? It seems that for some reason the compiler thinks you are declaring a variable here...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The_Kingpin08Author Commented:
Ok I found the problem. You were half right, the compiler thought I was declaring function so I predefined them at the beggining of my code and now it workd fine.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.