March 24th, 2013, 12:28 AM
guys, I want to say that I understand what Paul said. Is not that the C/C++ language is unsafe, but is rather that undefined behavior can occur if the program/programmer is out of the specifications.
A compiler might have bugs or not, but in this case we are talking about a code that does not meet specifications. That's why I decided to follow your suggestions, and had modified the code before to not take advantage of an unpredictable outcome, like if the 10 variables are stored contiguously. instead, something like an array or a structure must be used to make sure that this is enforced.
I wanted to say this because , it's probably that some novice users can reach to this thread and I don't want them to get wrong information , confusion or examples of a bad programming practice. I think we all want this to not happen, since we are oriented to provide solutions not problems.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!