Is there any special reason that when selecting input the choice of memory of the variable instead of the name of the scanf variable Is it yourself? I have definition of scanf which is the mandate above? But is there any special reason? Like C ++, if you want to take input, you can use cin & gt; & Gt; Will write var; but why not? Is there anything to keep this language fast?
This is because values working in C are passed by value < / Em>. And of course, the nominal languages of the variable are not present at the time of being named, at that time there are all addresses in memory. If you pass the variable directly, then you simply pass the value, which is required for But if you have done this with the Then the code inside printf () :
int A = 32; Printf ("a =% d \ n", a);
scanf () ', then it will get the integer value 32
, it did not know where it came from Was there. From the point of the caller variable to change scans (), you pass the address of the variable:
int a = 32; Scanf ("% d", & amp; one);
scanf () can enter a new integer value at the given address, causing
a .
No comments:
Post a Comment