Data in C


In C, the data you use in your programs will usually fall into one of the three
basic categories: int, char and float. Data in C has no
existence without an associated memory location labeled by an
identifier, usually referred to as a variable (the term variable
is a bit misleading, since it essentially means that it must always
vary, but you can have constant variables – i.e. variables whose
values do not vary). Considering this and C’s requirement for static
typing
, a variable declaration statement is required before data
can be stored in a variable. This declaration statement usually takes the
form of data-type var-name [= value], where the =value part may
or may not be present. For example, the statement int a=1;
declares a variable a which will store integer data and stores
1 in it. What this statment basically tells the C compiler is
that it should allocate a block of memory large enough to store an
integer and it will referred to as a. It is possible to obtain the
address of this memory location using the & operator.

Read the entire article here.

About these ads

One thought on “Data in C

  1. Pingback: Data in C and CPython: A comparison – bits from /home/gene

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s