which one is better structure or union?(other than the
space occupied )

Answer Posted / nishit jain

There is no question of which one is better. Both are there
for different functionality. Structures find more usage in
day-today programming, while unions are used less often.
There are examples where structure may not solve the purpose
but unions will work without much effort. Example :
packing-unpacking of data can be done using unions easily.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of keyword 'register' with respect to variables.

586


Which type of language is c?

642


Describe newline escape sequence with a sample program?

645


Write a program in c to replace any vowel in a string with z?

682


What are the uses of a pointer?

672






The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1624


Is c is a low level language?

555


How can you check to see whether a symbol is defined?

583


What is data types?

632


Explain how do I determine whether a character is numeric, alphabetic, and so on?

646


what do you mean by enumeration constant?

592


What does emoji p mean?

593


Multiply an Integer Number by 2 Without Using Multiplication Operator

314


What is maximum size of array in c?

578


What is c language & why it is used?

574