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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to print "hello world" without using a semicolon?

1023


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1968


What is the most efficient way to count the number of bits which are set in an integer?

1017


What is static memory allocation?

1120


List the different types of c tokens?

1019


What is indirection? How many levels of pointers can you have?

1101


Are enumerations really portable?

988


Explain the difference between getch() and getche() in c?

949


What is difference between arrays and pointers?

1029


What is extern variable in c with example?

968


Which built-in library function can be used to match a patter from the string?

1256


What is union and structure in c?

1170


What are the types of type specifiers?

991


What is calloc()?

1040


What is the description for syntax errors?

1106