bachra04
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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'
ASKER
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 ?
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 ?
ASKER