+ 3

What is the difference between array and structure?

10th Apr 2019, 7:03 AM
Archie Gupta
Archie Gupta - avatar
2 Answers
+ 2
Array can store only similar type variable..... While structure can store similar or different types of variable...
10th Apr 2019, 7:13 AM
Manish Kumar Kasera
+ 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 ; };
16th Jun 2019, 2:20 PM
V__