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
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
How a string is stored in c?
Explain what are its uses in c programming?
Explain can you assign a different address to an array tag?
What is use of bit field?
What does #pragma once mean?
Explain what is the most efficient way to store flag values?
How is a pointer variable declared?
write a progrmm in c language take user interface generate table using for loop?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is a node in c?
Is multithreading possible in c?
What are the header files used in c language?
Why do some versions of toupper act strangely if given an upper-case letter?
how logic is used