Link to home
Start Free TrialLog in
Avatar of bachra04
bachra04Flag for Canada

asked on

NULL parameter

This is  my function

Void MyFunction (unsigned char* uParam)
{
      // some code
}

When I call thefunction like this :

MyFunction (NULL);  

I get a compiler error “no  matching function for call to…” under LInux

In windows with VC6 I didn’t get this function.

Why do I get this problem ? and how to get around of it?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bachra04

ASKER

but if I want that my function can accept NULL as parameter independently from the compiler?
This should  not give you any trouble on either compiler. Sorry, but there always some thigs that are specific to the compiler or - like here - the "framework".
You may want to find out what your precompiler does ... check for a compile option that creates a list file. In the list file you should be able to see the exact 'translation'
I must reformulate my question :

This function is part of an API that we’ll offer for a customer (who is a developer).

I like my function able to accept NULL without any casting,
I thought about wrapping my parameter inside a struct .
DO you have a better idea ?