:: Home Page            
 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                      
Categories >> Software >> Programming Languages >> C


 C interview questions  C Interview Questions (2254)
 C++ interview questions  C++ Interview Questions (1111)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
what is difference between array and structure?
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
# 1
array -same data type
structure -diff datatype
Is This Answer Correct ?    507 Yes 45 No
# 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
Is This Answer Correct ?    384 Yes 37 No
# 3
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 ?    172 Yes 18 No
# 4
Array is a base pointer..
** it points to a particular memory location..

Structure is not a pointer..
Is This Answer Correct ?    172 Yes 42 No
# 5
collection is similar data type array
array always start from 0
array size fixed
Is This Answer Correct ?    89 Yes 30 No
# 6
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
Is This Answer Correct ?    67 Yes 14 No
# 7
array has indexed data type.
data type of structure is object type.
Is This Answer Correct ?    70 Yes 23 No
Kalyani Joshi
# 8
ARRAY:- An array can't have bit fields.

STRUCTURE:- Structure can contain bit fields.
Is This Answer Correct ?    61 Yes 14 No
# 9
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 ?    32 Yes 7 No
Siddharth Kothari
# 10
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:

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 ?    31 Yes 7 No

Other C Interview Questions
  Question Asked @ Answers
what is the output of the program and explain why?? #include<stdio.h> void main ( ) { int k=4,j=0: switch (k) { case 3; j=300; case 4: j=400: case 5: j=500; } printf (%d\n,j); } Oracle 14
what is c programming? TCS 3
int main() { int x = (2,3,4); int y = 9,10,11; printf("%d %d",x,y); } what would be the output? Wipro 7
Please write the area of a RIGHT ANGLED TRIANGLE.   1
what are the advantage and disadvantage of recursion   4
1,4,8,13,21,30,36,45,54,63,73,?,?. Franklin-Templeton 10
write a program to gat the digt sum of a number (et. 15= >1+5=6)   2
What is true about the following C Functions (a) Need not return any value (b) Should always return an integer (c) Should always return a float (d) Should always return more than one value TCS 2
write a program that accepts 3 numbers from the user. dispaly the values in a descending order.   2
write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};   5
For more C Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright 2013  All Rights Reserved.   ::