Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

> need help with c programming

views
     
cikelempadey
post Nov 24 2021, 05:31 PM

Getting Started
**
Junior Member
82 posts

Joined: Apr 2011
From: Your Nen Nen


basically u can think of any variable in C as a storage location in computer memory.

when u declare a variable, u are allocating a mempry storage for the variable, and the variable name refers to the value resides in that memory location.

when u use scanf, it needs a storage to store the input value, ie the address of a memory location, not the value residing in that location, hence the use of & as referring the address of the memory location/variable. with array, the variable name itself refers to the address of the start of the array (e.g string of chars) so u can use the array name itself as arg to scanf without the need to use &

 

Change to:
| Lo-Fi Version
0.0268sec    0.24    6 queries    GZIP Disabled
Time is now: 15th August 2022 - 03:41 AM