as I am starting to study at university we are learning how to write in C and we got to the point where I've learned that I can use pointers as function parameters but what they haven't told us is how to get the value from it. I am not able as a person who doesn't know about C as much, to come up with other solution than use two parameters (one as pointer to the variable and other as value. See the example which is not real code but it's just for purpose of demonstration:
int main(int argc, char* argv []) {
int a;
addNumber(&a);
}
void addNumber(int * a) {
*a = *a + 1; // this obviously does not work
}
Any input would be appreciated. Thanks!