+ 3
What is the difference between array and structure?
2 Answers
+ 2
Array can store only similar type variable..... While structure can store similar or different types of variable...
+ 2
Array is continuos collection of elements of SIMILAR data types...like int , float , char , etc...but only one data type for 1 array..
Its declaration is like
int a ; or
char s[10] ; or
float c ;
Structure is collection of elements of similar OR DISSIMILAR data type..like one structure can have float , int , char ,etc..at the same time
Its declaration is like
struct country
{ int cntrycode ;
char cntrynm[7];
float cntrygdp ; };