what is difference between array and structure?

Answers were Sorted based on User's Feedback



what is difference between array and structure? ..

Answer / kirankumar

Array takes data types of same kind where as structure takes
any kind.
Ex:int n[5];/* one d array
int n[10][10];/* two d array
int n[10][10][10];/* multi d array or jagged array
Structure takes following form:
struct class
{
cahr name;
int marks;
float sbuject[3];
}stuent[100];

Is This Answer Correct ?    1 Yes 1 No

what is difference between array and structure? ..

Answer / tsering dolma

array is collection of same data.
structure is collection of hetogenous data

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / tsering dolma

1. Array is collection of homogenous data and
structure is collection of hetogenous data

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / shiva

arry is derived data type,
structure is user defined data type

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / adilakshmi

Array elements are homogeneous type.
Structure elements are different data type.
Array is the pointer to the first element.
Structure is not a pointer.

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / chaudhary paresh

- Array elements are homogeneous. Structure elements are of
different data type.
- Array allocates static memory and uses index / subscript
for accessing elements of the array. Structures allocate
dynamic memory and uses (.) operator for accessing the
member of a structure.
- Array is a pointer to the first element of it. Structure
is not a pointer
- Array element access takes less time in comparison with
structures.

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / viji

array is the collection of same data items are declare under
common name

structure is the collection of different data items are
declare under different name which are accessed under common
name.

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / monishasyed

Array is same data type
it can not bit field
it has the base pointer
structure is the different data type
it can bit field
it has the poiter

Is This Answer Correct ?    0 Yes 0 No

what is difference between array and structure? ..

Answer / dhivya

when we are declaring an array a variable is enough with
the size.
when we are declaring structure it contain different data
types.

Is This Answer Correct ?    16 Yes 18 No

what is difference between array and structure? ..

Answer / kirankumar

Array is used to represent a group of data items that
belongs to the same type or kind.
int a[5];
i.e a[0],a[1],a[2],a[3],a[4].
all a values are integer types.


If we want to represent data items of different types using
a single name is called strucute.
Ex:struct book
{
char title[20];
int pages;
float price;
};

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

we compile c program in 32 processor and 64 bit processor .exe file is created in both the processors. if we want to run .exe file in 64 bit processor which is created in 32 bit processor. is that .exe file is run or not if it is not run why?

4 Answers   HP, Wipro,


What is the value of uninitialized variable in c?

0 Answers  


How do you print an address?

0 Answers   TCS,


Explain how can you tell whether two strings are the same?

0 Answers  


1. Duplicate the even numbers. -1 Sample I/O Array1:- 4,2,24,3,22 Updated Array:- 4,4,2,2,24,24,3,22,22 2. Reverse the array in a region - 1 Sample I/O Array1:- 4,2,24,3,22,41,21 Enter Region:- 2,5 Update Array:-4,41,22,3,24,2,21 3. Store first the even digits in an array and then odd digits in same array -2 Sample I/O Array1:- 4,2,24,3,22,41,21 Array 2:- 4,2,2,4,2,2,4,2,3,1,1 4. Store the count of the digits in all numbers in an array and print the count. -2 Sample I/O Array1:- 4,2,9,3,7,41,28 Array 2:- 0,1,1,1,2,0,0,1,1,1 1-1;2-1;3-1;4-2;7-1;8-1;9-1 5. Store all palindrome numbers in to another array -2 Sample I/O Array1:- 4,22,9,313,7,141,28 Array 2:- 4,22,9,313,141 6. Arrange the array in such a way that odd numbers come first and then even numbers -1 Sample I/O Array1:- 4,22,9,313,7,141,28 Update Array1:- 9,313,7,141,4,22,28 7. Store into another array by inserting it in the right place - 2 Sample I/O Array1:- 4,22,9,313,7,141,28 Array2:- 4 /4,22 /4,9,22 /4,9,22 ,313 /4,7,9,22 ,313 /4,7,9,22 ,141,313 / 4,7,9,22,28 ,141,313 8. Merge two sorted arrays in a sorted fashion - 3 Sample I/O Array 1:- 3,6,7,9,11,16 Array 2:- 1,2,5,7,20 Array 3:- 1,2,3,5,6,7,9,11,16,20 9. Upadte the array so that an array element is followed by its revere - 1 Sample I/O Array 1:- 13,63,74,9,11,16 Updated Array 1:- 13,31,63,36,74,47,9,9,11,11,16,16 10.Spread the digits of the array in the same array. -1 Sample I/O Array 1:- 13,63,74,9,11,16 Updated Array 1:-1,3,6,3,74,9,1,1,1,6 11.Shift the boundary of array to have only 2 digit numbers. Sample I/O Array 1:- 139,643,74,9,101,126 Updated Array 1:- 13,96,43,74,91,11,26 12.Print the largest occuring digit in an array of N numbers. Sample I/O Array 1:- 13,63,74,9,11,16 1 occurs most.

2 Answers   Intel,


Does * p ++ increment p or what it points to?

0 Answers  


What are the languages are portable and platform independent?Why they are like that?

1 Answers   Excel, Satyam,


#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(“%d” ,a[i]); }

8 Answers  


triangle number finding program...

1 Answers   HCL,


program to find the ASCII value of a number

8 Answers  


How #define works?

0 Answers  


What are the advantages of using linked list for tree construction?

0 Answers  


Categories