So Im relatively new to c programming, in fact Im only taking this class as prerequisite to my major. So pointers are a rather foreign concept to me. For this specific assignment we are not allowed to use any refernce variables and must use memory allocation(malloc) in order to store values. For one of the parts however it asks to print the result of the product of 3 numbers(all assigned to an address by a pointer not a reference variable) my question is how do you multiply or really do any arithmetic using only pointers to point to the address of the values. I want to emphasize i do not want to multiply the address itself because im not sure that would help me. Again im very new to all this so any help would be greatly appreciated.
int main()
{
int *a , *b, *c, *product;
product = malloc(sizeof(float));
a = malloc(sizeof(int));
b = malloc(sizeof(int));
c = malloc(sizeof(int));
*a = 1;
*b = 2;
*c = 3;
*product = //this is where id assume itd go
}
The assignment specifically says not to use reference variables so im not entirely sure how he wants us to go about it. Thanks.