what is difference between array,strutter,union and pointers

Answer Posted / shashidhar

array can contain single data type
Structure is collection of different data types
Unions can also contain different data types, but here the
different date types share the same memory within the
computers memory

ex:
==========================
|| ||
==========================

in the above the memory between || || is shared by int,
float, double declarations in a UNION.
where as in struture || || || the memory
declared for int and float and double are different.
which implies memory utilization is better in union.

When you come to pointers, well it can point to a data type
(like int) can point to a structure (struct xyz{ };) , it
can point to a union (union item { }; ) so its like a honey
BEE it can sit on anything

Is This Answer Correct ?    54 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you please explain the difference between syntax vs logical error?

699


Write a program of advanced Fibonacci series.

711


What is typedef example?

621


What is the value of c?

576


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

611






Is that possible to add pointers to each other?

907


Explain about the constants which help in debugging?

858


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

671


What is an auto variable in c?

760


What is d'n in c?

638


Mention four important string handling functions in c languages .

634


How do you do dynamic memory allocation in C applications?

634


What is meant by gets in c?

611


Describe newline escape sequence with a sample program?

660


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1629