C does not have references. You need to pass a pointer to the variable you wish to modify:
int locate(char *name, int *s, int *i)
{
/* ... */
*s = 123;
*i = 456;
}
int s = 0;
int i = 0;
locate("GMan", &s, &i);
/* s & i have been modified */
More Related Contents:
- Changing address contained by pointer using function
- How do I modify a pointer that has been passed into a function in C?
- C Programming: malloc() inside another function
- How do you pass a function as a parameter in C?
- Function pointers and address of a function
- Meaning of “referencing” and “dereferencing” in C
- Parameter Passing in C – Pointers, Addresses, Aliases
- Function pointer vs Function reference
- Returning Arrays/Pointers from a function
- Changing array inside function in C
- How is the result struct of localtime allocated in C?
- When is an array name or a function name ‘converted’ into a pointer ? (in C)
- How can I return a character array from a function in C?
- What is the real difference between Pointers and References?
- Passing an Array by reference in C
- Function pointer as a member of a C struct
- What is the function of an asterisk before a function name?
- C pointer notation compared to array notation: When passing to function
- C pointer to array/array of pointers disambiguation
- Difference between passing array and array pointer into function in C
- Pointers in C: when to use the ampersand and the asterisk?
- Override a function call in C
- Is NULL always zero in C?
- Why are references not reseatable in C++
- constant pointer vs pointer on a constant value [duplicate]
- how does the ampersand(&) sign work in c++? [duplicate]
- Why can´t we assign a new string to an char array, but to a pointer?
- Can an equality comparison of unrelated pointers evaluate to true?
- “int *nums = {5, 2, 1, 4}” causes a segmentation fault
- Regex to pull out C function prototype declarations?