EmbLogic's Blog

c_basic

why we do not use address operator before variables in printf statement for fetching value: example: printf(“%d”,&a);

One Response to c_basic

  1. virender kadain says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>