| ??? 04/29/03 11:48 Read: times |
#44482 - RE: data change when passing parameter Responding to: ???'s previous message |
If you are trying to change the value of the pointer (ie the memory location the pointer is pointing to) from within the function you need to pass a 'pointer to the pointer' to the function. Dereferencing this one level will allow you to change the memory location pointed to:
void main(void) { char *ptr; Fn(&ptr); } void Fn(char **p) { *p++; //Increments pointer in main } |
| Topic | Author | Date |
| data change when passing parameter | 01/01/70 00:00 | |
| RE: data change when passing parameter | 01/01/70 00:00 | |
| RE: data change when passing parameter | 01/01/70 00:00 | |
| RE: data change when passing parameter | 01/01/70 00:00 | |
Clarify the question | 01/01/70 00:00 |



