The question does not make very much sense. Like how a car is different from an apple?
array is not a variable, but a data structure. A variable can, in praticular, be of an array type or of any other type. Perhaps, it's this distinction that you meant? If so, there isn't any. A variable of an array type is similar to a variable of any other type in any concievable way.
2006-11-07 23:37:22
·
answer #1
·
answered by n0body 4
·
0⤊
0⤋
Array is a collection of a single type of variable.
For eg:
int a; // This is how u define a variable of integer type.
Now if u want to store 10 variables of type integer under one name then u do it using an array as follows
int a[10]; // Nw the variable a can store ten int variables.
U can access the first variable in array from a[0] and the last variable as a[9].
U can initialize as
a=5; // for the first type ie single variable.
Now if it is an array u can initialize individually as
a[0]=5; // This assigns 5 to the first index of the array a[10]
Also u can use for loop or enumeration to initialize an array.
I hope u knw all those.
Bye
Take care.
2006-11-09 02:10:11
·
answer #2
·
answered by kaun 2
·
0⤊
0⤋
an ordinary variable stores either a character,integer or a floating point no whereas an array is a collection of data which are strictly of the same type(i.e float,int or character).an array of characters is called a 'string'.
in a variable,the actual value is stored at the given location whereas in an array, the array name indicates the address of the first element (base element) of that array.
2006-11-08 08:19:18
·
answer #3
·
answered by amish s 2
·
0⤊
0⤋
In c++ an ordinary variable cantains single information like a simple variable may be 24(in case of integer) or A(in case of character).
But in the case of array there may be many values exist in one array on diffrent index this value type depends on the array type
(like integer, character, float etc).
Example
Variable
int x=24;
Array
int y[5]=(2,6,3,9,1)
in this case simple variable x is remains 24 untill it not changes by code
in the case of array y gives
y[0]=2
y[1]=6
.
.
.
y[4]=1
Thanks
Sumit
2006-11-09 03:34:43
·
answer #4
·
answered by sumit s 1
·
0⤊
0⤋
hope u know the concept of the 'memory assingment'...keeping this in mind we can explain an array variable as a pointer variable which stores the starting address of the array...but in the case of the ordinary variable it contains the stored value itself...
2006-11-08 07:38:21
·
answer #5
·
answered by joj 2
·
0⤊
0⤋
an ordinary variable can hold only a single data but an array can hold multiple entries of the same data type
2006-11-09 03:08:33
·
answer #6
·
answered by Nid 2
·
0⤊
0⤋
By the ammount of memory alocated for them...
Short example:
int array[100];
differs from
int array;
by the fact that the first has 100 time more memory allocated, and of course let's not forget the [ ] operator specific only to arrays... (if not overloaded of course :D)).
2006-11-08 09:35:01
·
answer #7
·
answered by None A 3
·
0⤊
0⤋
hi,
an Array is used to store large amount of data in a single variable name
ie int a[5]
where only interger type of data can be stored
where as variabl;es can store the data which we specify with a specific datat type
ie int can stor only integer type of data
etc
2006-11-08 11:35:06
·
answer #8
·
answered by koganti 2
·
0⤊
0⤋
Array will store a range of variables of the same type. e.g. int arr[10] can store 10 integers, but int arr can store only one variable.
2006-11-08 23:32:25
·
answer #9
·
answered by manoj Ransing 3
·
0⤊
0⤋
Learn to ask questions.
What is your array?
What type of data does it contain?
It seems, you, with your homework, have not enough courage to ask: "Ho will help me?" :-)
2006-11-08 07:33:23
·
answer #10
·
answered by alakit013 5
·
0⤊
0⤋