ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
what is difference between array and structure?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is difference between array and structure?
Answer
# 1
array -same data type
structure -diff datatype
 
Is This Answer Correct ?    75 Yes 10 No
Rajesh
 
  Re: what is difference between array and structure?
Answer
# 2
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 ?    66 Yes 7 No
Rajkumars
 
 
 
  Re: what is difference between array and structure?
Answer
# 3
Array is a base pointer..
** it points to a particular memory location..

Structure is not a pointer..
 
Is This Answer Correct ?    22 Yes 10 No
Shruti
 
  Re: what is difference between array and structure?
Answer
# 4
chaining and open addressing in hash table ?
 
Is This Answer Correct ?    11 Yes 12 No
Rajprasadmaity
 
  Re: what is difference between array and structure?
Answer
# 5
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 ?    36 Yes 4 No
Vinay
 
  Re: what is difference between array and structure?
Answer
# 6
collection is similar data type array
array always start from 0
array size fixed
 
Is This Answer Correct ?    12 Yes 7 No
Rajprasadmaity
 
  Re: what is difference between array and structure?
Answer
# 7
array has indexed data type.
data type of structure is object type.
 
Is This Answer Correct ?    13 Yes 7 No
Kalyani Joshi
 
  Re: what is difference between array and structure?
Answer
# 8
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 ?    14 Yes 3 No
Ira
 
  Re: what is difference between array and structure?
Answer
# 9
ARRAY:- An array can't have bit fields.

STRUCTURE:- Structure can contain bit fields.
 
Is This Answer Correct ?    9 Yes 3 No
Reema
 
  Re: what is difference between array and structure?
Answer
# 10
structure is user defined!


c program for printing employee details using union ??
 
Is This Answer Correct ?    6 Yes 6 No
Sruthi
 
  Re: what is difference between array and structure?
Answer
# 11
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 ?    9 Yes 2 No
Siddharth Kothari
 
  Re: what is difference between array and structure?
Answer
# 12
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 ?    1 Yes 4 No
Dhivya
 
  Re: what is difference between array and structure?
Answer
# 13
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 ?    9 Yes 1 No
Shweta
 
  Re: what is difference between array and structure?
Answer
# 14
Array is Spelled Array 

While Structure is spelled Structure.
 
Is This Answer Correct ?    3 Yes 10 No
Hfghfgh
 
  Re: what is difference between array and structure?
Answer
# 15
structure: structure is a collection of variable, reference 
under convinent mean of keeping related information.
 
Is This Answer Correct ?    2 Yes 2 No
Sushil
 
  Re: what is difference between array and structure?
Answer
# 16
ARRAYS: -
An array may contain a number of items all of the SAME TYPE,
including user-defined types such as structures (see above).
 Structure: -
In the C programming language, a structure may contain
MULTIPLE DATA TYPES, also including arrays of those types,
and the structure becomes a USER-DEFINED type.
 
Is This Answer Correct ?    3 Yes 1 No
Sajid Ali Khan
 
  Re: what is difference between array and structure?
Answer
# 17
array starts from a

and structure means  36-24-36

most significant diffrence
 
Is This Answer Correct ?    1 Yes 1 No
Ankur
 
  Re: what is difference between array and structure?
Answer
# 18
array is a homogenous data types.
structure is a user defined data types...
 
Is This Answer Correct ?    1 Yes 0 No
Chinmayee
 
  Re: what is difference between array and structure?
Answer
# 19
array= array is collection of similar data items 
structure= structure is a collection of dissimilar data 
items
 
Is This Answer Correct ?    0 Yes 0 No
Uttam Kumar Das
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How to add two numbers without using arithmetic operators? Sapient11
define function Assurgent4
Write a program to interchange two variables without using the third variable? Accenture11
how to print "hai" in c?  10
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?  1
sir, i cannot find the way how to write aprogram by using array on queue IISIT1
What is an object?  3
how to impliment 2 or more stacks in a single dimensional array ? iFlex1
pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words ) Persistent1
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?  1
consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none TCS4
what is object oriental programing?  1
what is disadvantage of pointer in C Tech-Mahindra5
# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none TCS5
how many times of error occur in C  7
How would you find a cycle in a linked list?  2
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator?? Verifone8
What is meaning of "Void main" in C Language. TCS8
Find string palindrome 10marks Honeywell5
What's a "sequence point"?  2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com