When you call &variable in C, it's the same as C++, and returns the location of the variable, instead of the variable itself, right?
and in my case scanf("%f", &wages);
Or am I totally off now? xD
thanks in advance!
This is a discussion on C references within the C Programming forums, part of the General Programming Boards category; When you call &variable in C, it's the same as C++, and returns the location of the variable, instead of ...
When you call &variable in C, it's the same as C++, and returns the location of the variable, instead of the variable itself, right?
and in my case scanf("%f", &wages);
Or am I totally off now? xD
thanks in advance!
Currently research OpenGL
Yep yep!![]()
Yes, &variable is the address of a variable.
scanf expects a pointer, which is an address, so
stores the value at the address of wages.Code:scanf("%f", &wages);
OS: Linux Mint 13(Maya) LTS 64 bit.