Check if one parameter has been passed to a function

Hi
I want to check if parameters that I pass to one function,are passed correctly to that function,or not.of course parameters are passed by pointer.
Is there any way for check this?

Thanks in advance
That's frighteningly vague. Do you have an example?
You can initialize a function parameter to null since it is a pointer, then in function use a chek to c that if its still null or not, if not than is it pointing to its type of object, if it is then it is correct...like that....
Parameters will always be passed correctly, unless the calling code is corrupted. The chances of this are very unlikely.

Now, whether the parameters' states meet your function's requirements is a different story - you need to give us more information.
Last edited on
this is kinda vague. If you know the value of whatever you are passing (assuming its a variable) then you could just take cout it once inside the function and check its value. If it is an object of some sort then it gets a bit more complicated, you could call a member of that object that could display some value which would tell you if you passed it correctly. Those are the two most general examples I can think of but there are really to many variations of this topic to give a specific answer without more details.
Thanks for your quick reply
I have a function with this prototype :
int My_Function (const structure Packet_Data * Passed_Packet_Data)
in another function I pass my data to this function. after debug in Eclipse I found that only fist X byte of passed data is correct.
I can X byte re-cast to other type and from X+ byte, all value is zero!!
Excuse me. It was my fault in assign enough buffer !!
Anyhow thanks a lot.
Topic archived. No new replies allowed.