Click here to Skip to main content
15,898,939 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all
I have a function which its return value is okay in debugging mode but when I run .exe alone the value seems(msg value) random.

What I have tried:

My function
void recv(int &id, char * msg, int & len)
{
//full msg buffer and len
}
Posted
Updated 4-Dec-18 2:32am
Comments
Richard MacCutchan 4-Dec-18 8:46am    
That function does not produce a return value.

1 solution

You should look at proper variable initialization (as rule, you should initialize all of your variables). While debug builds put zeroes in uninitialized variables, in release build you find garbage inside them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900