what is difference between array and structure?

Answer Posted / sreejith av

ARRAY:
An array is defined as a group of related data items stored by means of a single variable name.

STRUCTURE:
Structure is defined as a data type to represent several different types of data with a single name.

DIFFERENCE BETWEEN ARRAYS AND STRUCTURES:
1.All data in a array should be of same data type.But in structures data can be of different data types.
2.Individual entries in an array are called elements.But in structure individual entries are called members.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the bubble sort algorithm.

654


What is || operator and how does it function in a program?

639


What are the basic data types associated with c?

824


If errno contains a nonzero number, is there an error?

816


Can we change the value of #define in c?

592






using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1327


What is calloc() function?

631


Is multithreading possible in c?

575


How to throw some light on the b tree?

611


Can 'this' pointer by used in the constructor?

621


What is the difference between single charater constant and string constant?

632


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

737


Why c language is called c?

579


what is stack , heap ,code segment,and data segment

2229


Explain what standard functions are available to manipulate strings?

618