C passes values not arguments — that is what I am told, but how do I fix this? I just don't understand.
#include <stdio.h>
/* This will not work */
void go_south_east(int lat, int lon) {
lat = lat - 1;
lon = lon + 1;
}
int main() {
int latitude = 32;
int longitude = -64;
go_south_east(latitude, longitude);
printf("Now at: [%i, %i]\n", latitude, longitude);
printf("The log pointer is at %x\n", longitude);
}
It doesn't update the values in main()
— they stay at 32, -64 but should be 31, -63.