Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (ranjith):

why do we use & in scanf

OpenStudy (anonymous):

Because you are passing an address. You are giving it the address where you want to store the data. All your variables are outside the scope of the function, and the only way for the function to modify one of your variables is to pass it a pointer. Giving it the address of your variable, it can directly store your data into that address without having the variable in its scope.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!