C: scanf int assign functions required by the address-pointer &

Assignment to function with a scanf int variables, found an error.

int country_num=0;

scanf ( "% d", country_num); // error, run error

After a review found that need to address-pointer with &.

scanf ( "% d", & country_num); // correct

Guess you like

Origin www.cnblogs.com/dongshenscut/p/12344451.html