Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is difference between array and structure?

Answers were Sorted based on User's Feedback



what is difference between array and structure? ..

Answer / rajesh

array -same data type
structure -diff datatype

Is This Answer Correct ?    630 Yes 51 No

what is difference between array and structure? ..

Answer / rajkumars

Array:Static memory allocation.
It uses the subscript to access the array elements.

Structure:Dynamic memory allocation.
It uses the dot(.)operator to access the structure
members.

Is This Answer Correct ?    460 Yes 48 No

what is difference between array and structure? ..

Answer / vinay

Array -
* Memory (array size) is fixed
* Accessing an element in array takes constant time. E.g. -
5th element in an array can be accessed as array[4] i.e.
searching/accessing an element in array takes comparatively
less time than in structures.
* Adding/deleting an element in the array is comparatively
difficult since the data already present in the array needs
to be moved
Structure -
* Memory (structure size) can be changed dynamically
* Accessing an element in a list takes more time
comparatively since we need to traverse thro the list
* Adding/deleting takes less time than in arrays

Is This Answer Correct ?    208 Yes 28 No

what is difference between array and structure? ..

Answer / shruti

Array is a base pointer..
** it points to a particular memory location..

Structure is not a pointer..

Is This Answer Correct ?    209 Yes 50 No

what is difference between array and structure? ..

Answer / rajprasadmaity

collection is similar data type array
array always start from 0
array size fixed

Is This Answer Correct ?    123 Yes 36 No

what is difference between array and structure? ..

Answer / ira

Are you sure that Structure is object oriented, because
structs came from C, and C wasn't an object-oriented
program, and C++ was using it at the beginning where now
they use class for the same function which is better

Array is a collection of a fixed number of components all of
the same type: it is a homogeneous data structure.

structs (records) - we use them to group items of different
types; a collection of a fixed number of components in which
the components are accessed by name. The components as
mention can be of different types. A struct is typically
heterogeneous.

Is This Answer Correct ?    82 Yes 20 No

what is difference between array and structure? ..

Answer / reema

ARRAY:- An array can't have bit fields.

STRUCTURE:- Structure can contain bit fields.

Is This Answer Correct ?    82 Yes 22 No

what is difference between array and structure? ..

Answer / kalyani joshi

array has indexed data type.
data type of structure is object type.

Is This Answer Correct ?    86 Yes 28 No

what is difference between array and structure? ..

Answer / shweta

Both arrays and structures are classified as structured data
type as provide a mechanism that enables us to access and
manipulate data in relatively easy manner. but they differ
in number of ways:-
1)An array is a collection of related data elements of same
type. Structure can have elements of different types.
2. An array is derived data type whereas a structure is a
programmer defined one.
3) An array behaves like a built in data types only we need
to declare it.but in case of structures , first we have to
design and declare a data structure before the variables of
that type are declared and used.


example:of array:

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];//only declare an array variable




example of structure:
struct book_bank
{
char title[5];
char author[3];
int pages;
float price;
};// this format of defining is also known as TEMPLATE
struct book_bank book1, book2;// declaration of variable

Is This Answer Correct ?    48 Yes 14 No

what is difference between array and structure? ..

Answer / siddharth kothari

An array behaves like a built-in data type. All we have to
do is to declare an array variable and use it. But in the
case of a structure, first we have to design and declare a
data structure before the variables of that type are
declared and used

Is This Answer Correct ?    44 Yes 15 No

Post New Answer

More C Interview Questions

How to find the digits truncation when assigning the interger variable to the character variables. like int i=500; char x = i : here we have truncation. how to find this. another ex: i =100; char x=i. here we do not have truncation.

1 Answers   HCL,


Write a program to reverse a given number in c language?

0 Answers  


how to make program without <> in library.

1 Answers   ADITI,


Will Macros support multiple arguments ?

7 Answers   Oracle,


what do you mean by enumeration constant?

0 Answers  


How can I manipulate individual bits?

0 Answers  


What are qualifiers in c?

0 Answers  


how do you redirect stdout value from a program to a file?

1 Answers  


What is meant by errors and debugging?

0 Answers  


What is include directive in c?

0 Answers  


Which one would you prefer - a macro or a function?

0 Answers  


Differentiate fundamental data types and derived data types in C.

0 Answers   HCL,


Categories