therefore no value should be in the return statement. When a return
statement is encountered, the function returns immediately to the calling
routine. Any statements after the return statement are not executed.
Pointers and Arrays
Pointers
A pointer is a variable that contains the address of another variable. For
example, if a pointer variable, namely varpoint, contains the address of a
variable var, then varpoint points to var. The syntax to declare a pointer
variable is
data-type *var_name;
The
data-type
of a pointer is a valid C data type. It specifies the type of
variable that
var_name
points to. The asterisk (*) prior to
var_name
tells the
C compiler that
var_name
is a pointer variable.
Two special operators, the asterisk (*) and ampersand (&), are associated
with pointers. The address of a variable can be accessed by preceding this
variable with the & operator. The * operator returns the value stored at the
address pointed to by the variable.
In addition to * and &, there are four operators that can be applied to the
pointer variables: +, ++, -, --. Only integer quantities may be added or
subtracted from pointer variables. An important point to remember when
performing pointer arithmetic is that the value of the pointer is adjusted
according to the size of the data type it is pointing to.
Arrays
An array is a list of variables that are of the same type and which can be
referenced by the same name. An individual variable in the array is called
an array element. The first element of an array is defined to be at an index
of 0 and the last element is defined to be at an index of the total elements
minus one. C stores one-dimensional arrays in contiguous memory loca-
tions. The first element is at the lowest address. C does not perform
boundary checking for arrays.
Assignment from an entire array to another array is not allowed. To copy,
each individual element must be copied one by one from the first array into
the second array. Any array element can be used anywhere a variable or a
constant can be used.
HT-IDE User’s Guide
100
Summary of Contents for HT-IDE
Page 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Page 12: ...HT IDE User s Guide 2 ...
Page 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Page 24: ...HT IDE User s Guide 14 ...
Page 70: ...HT IDE User s Guide 60 ...
Page 76: ...HT IDE User s Guide 66 ...
Page 92: ...HT IDE User s Guide 82 ...
Page 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Page 94: ...HT IDE User s Guide 84 ...
Page 148: ...HT IDE User s Guide 138 ...
Page 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Page 154: ...HT IDE User s Guide 144 ...
Page 192: ...HT IDE User s Guide 182 ...
Page 194: ...HT IDE User s Guide 184 ...
Page 218: ...HT IDE User s Guide 208 ...
Page 235: ...P a r t V Appendix Part V Appendix 225 ...
Page 236: ...HT IDE User s Guide 226 ...
Page 250: ...HT IDE User s Guide 240 ...