I have int foo which has the address of an integer in it.
How do I add to the integer that foo is pointing to in one line?
Solution:
(*(int *)foo)+=1
This is how I handled it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To add to the value the pointer is pointing to: