Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me in C

Status
Not open for further replies.

vrl3

Mechanical
Nov 4, 2001
12
0
0
IN
In programming language 'C' can we change the value of a variable without touching the variable in any sense?
 
Replies continue below

Recommended for you

A bit more detail with an example:

//Declare an integer variable val and initialize it
int val = 0;

//Get the address of the variable 'val
int *pVal = &val;

//Change the value of the variable val without
//touching the variable name 'val'

*pVal = 10;

// Now, you've changed the value of val
Narayanan UM
umn@ieee.org
asaan@lycos.com

 
Status
Not open for further replies.
Back
Top