Search
 
SCRIPT & CODE EXAMPLE
 

C

C Accessing Union Members

#include <stdio.h>
union Job {
   float salary;
   int workerNo;
} j;

int main() {
   j.salary = 12.3;

   // when j.workerNo is assigned a value,
   // j.salary will no longer hold 12.3
   j.workerNo = 100;

   printf("Salary = %.1f
", j.salary);
   printf("Number of workers = %d", j.workerNo);
   return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: C Syntax of return statement 
C :: gandhi ashram saharanpur 
C :: columntransformer in randomizedsearchcv 
C :: printing a string with putchar 
C :: sOY wapo ya lo c 
C :: c program for calculating product of array 
C :: what happens if i acess a freed variable in c 
C :: string text line 
C :: C Keyword typedef 
C :: esp local control 
C :: how to define pi in c 
C :: how to get out of function in c 
C :: code wars responsable drinker 
C :: how to write flash memory in stm32f030 
C :: how to input a para in c 
C :: python project script run 
C :: 25802 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of D:Devtoolsminicondalibsite-packages ensorflowpythonclient\_pywrap_tf_session.pyd 
C :: how to initiate pointer array with null in c 
C :: adding three numbers in c 
C :: under 
C :: c refresher 
C :: too many arg 
C :: q2. wap in c to input 5 numbers in an array and display in reverse order. 
C :: wordpress clean name spaces 
C :: sort linked list c 
C :: arrays c 
Dart :: listview.separated flutter 
Dart :: how to change input text color in flutter 
Dart :: flutter insecure http is not allowed by platform 
Dart :: how to stop screen rotation in flutter 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =