Hi.. welcome to
mysite in “We Are Knowledge”, course in “have-fun-and-enjoy.blogspot.com”.
I recommend you must
reading this article and other
article,because you will getting many IT knowledge, and I've made in a form
as simple as possible. which allow you to learn and easy for you to understand
Still with knowledge of dekstop programming is “C++”, and
disscus about “ARRAY”. You Know Array in C ++ ???..
Ok.. let’s do read my article…
ARRAY in C ++ likely array in other language programming,
and mean of array is set or group of elements (variables) of the same type are
stored sequentially in memory.
Syntax of ARRAY :
type name [elements];
1. Array Initialization
declaring a local array (within function), for which no
value dib the contents of the array can not be determined (undetermined) to the
value given. If you declare an array of global array (outside any function)
then the contents of the array will be iniisialisasikan as 0 (zero)
2. Access
to the values of an Array.
Values array we can also access by one individual or group
not.
Syntax:
name[index]
You can copy this coding and paste in your compiler likely
borland or turbo.
example :
#include <iostream.h>
#include <conio.h>
int moon [] = {1, 2, 3, 3, 5, 6, 7, 8, 9, 10, 11, 12};
int a, result=0;
int main ()
{
for ( a = 0 ; a <
12 ; a ++ )
{
result += moon[a];
}
cout <<
result;
getch();
}
Press ”alt + F9”
>> compile
Press “ctrl + F9” >> running
To result :
77
NOTE ::
If you using copy and paste please change all quotes (“ “) or (‘ ‘).
3. Multidimensional Array
Multidimensional arrays can be considered as arrays of
arrays, the array can be either 2-dimensional array or a dimension much.
Ok.. just it..
I hope you understand with my article…
See you later
No comments:
Post a Comment