Help me in C
Help me in C
(OP)
In programming language 'C' can we change the value of a variable without touching the variable in any sense?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: Help me in C
by the use of pointers.
That is what we do by in writing functions
RE: Help me in C
//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