What is the use of unions in c ?, Computer Engineering

Unions allow the same area of memory to be accessed as different data types. The insurance example above would not work.

Unions are useful (often in embedded programming) when it is needed to refer to a data item as two or more different types: e.g. it may be used as an integer for math, but an array of bytes for a serial transmission or a checksum calculation.

Posted Date: 3/11/2013 5:55:09 AM | Location : United States







Related Discussions:- What is the use of unions in c ?, Assignment Help, Ask Question on What is the use of unions in c ?, Get Answer, Expert's Help, What is the use of unions in c ? Discussions

Write discussion on What is the use of unions in c ?
Your posts are moderated
Related Questions
Given the following interface public interface WordSet extends Iterable { public void add(Word word); // Add word if not already added public boolean contains(Word word);

What is Machine.config?  Machine configuration file: The machine. config file contains settings that apply to the whole computer.  The machine.config, which can be found in the

Explain the DAA DAA instruction follows the ADC or ADD instruction to adjust the result into a BCD result. DAA instruction functions only with the AL register, this addition sh

Explain Combinational logic circuits Ans. Combinational logic circuits:- (i) Outputs only depend upon present state of the input. (ii) No memory element present or no f

What are the different types of parameters? Formal Parameters: Parameters, which are described during the definition of subroutine with the FORM statement.

Give the formula for the average access time experienced by the processor in a system with 2 levels of caches. Ans: Formula is for the average access time experienced by the pr

Clear operation The clear operation compares words present in A and B and produces an all 0's result if two numbers are equal. This operation is achieved by the exclusive-OR mi

What is semaphores?  A semaphore 'S' is a synchronization tool which is an integer value that, apart from initialization, is accessed only by two standard atomic operations; wa


How are problems of clock skew minimized? Clock skew, when done right, can also benefit a circuit. This can be intentionally introduced to reduce the clock period, at that the