what is difference between array and structure?

Answer Posted / ira

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
heterogeneous.

Is This Answer Correct ?    82 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Ow can I insert or delete a line (or record) in the middle of a file?

566


Can a pointer be null?

552


How pointers are declared?

554


What do you mean by c?

578


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1734






Are local variables initialized to zero by default in c?

541


what do you mean by enumeration constant?

588


What are # preprocessor operator in c?

621


Do you have any idea how to compare array with pointer in c?

592


What is indirection?

641


praagnovation

1768


What is the purpose of the statement: strcat (S2, S1)?

636


What does the error message "DGROUP exceeds 64K" mean?

720


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

908


What does %2f mean in c?

670