why we do not use address operator before variables in printf statement for fetching value: example: printf(“%d”,&a);
why we do not use address operator before variables in printf statement for fetching value: example: printf(“%d”,&a);
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
because,c only pass the argument by value.
if you want a function to change the content of a variable that is not local to the function.you pass the address of a variable to the function.scanf() reads value into variable
(that are not local to the scanf()).so you have to pass the address of a variable you want those value to be in.but in case of printf(),we does not need to change the content of a variable.