|
-
November 6th, 2012, 12:19 PM
#5
Re: dereferencing char pointers
 Originally Posted by tuli
why doesnt the following program work as expected:
Two guidelines that can help to prevent these kinds of errors are:
- Don't use magic numbers. If you use a const variable for the value 0xff, you make the type of that variable explicit.
- Don't mix signed and unsigned arithmetics. Signed values will get promoted to unsigned, which can cause unexpected results.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|