:: 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 (2266)
 C++ interview questions  C++ Interview Questions (1121)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (652)
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 ?    518 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 ?    390 Yes 38 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 ?    176 Yes 19 No
# 4
Array is a base pointer..
** it points to a particular memory location..

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

STRUCTURE:- Structure can contain bit fields.
Is This Answer Correct ?    62 Yes 15 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 ?    32 Yes 7 No

Other C Interview Questions
  Question Asked @ Answers
while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know. Tcs 1
how memory store byte Huawei 4
code for concatination of 2 strings with out using library functions?   3
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }   3
How we can set and clear bit in a byte using macro function? L&T 2
in one file global variable int i; is declared as static. In another file it is extern int i=100; Is this valid ? NetApp 4
Explain following declaration int *P(void); and int (*p)(char *a);   2
1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration? nvidia 2
how the size of an integer is decided? - is it based on processor or compiler or OS? nvidia 19
Read two numbers from keyboard and find maximum of them?   1
different between overloading and overriding   3
Input is "Jack and jill went up a hill" To print output is 1-letter word(s)-1 2-letter words-1 3-letter words-1 4-letter words-4 Mind-Tree 1
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.   ::