Understand Programming
  • Home
  • Python
  • JavaScript
  • Swift
  • Testing
  • C/C++
  • SE
  • Android
  • About Me

union

Pointer to union

May 20, 2015 / Leave a Comment

Pointer to union is as same as pointer to structure. If you have confusion about pointer to structure, I suggest you to read Pointer to structures first and then continue reading. Lets see how pointer to union works. union Student          //  name of the union Student { double phone;           // member variable long for phone … Continue Reading….

Posted in: C/C++ Tagged: C, Pointers, struct, union

Difference between union and structure

May 20, 2015 / 2 Comments

In previous articles you have learnt the similarity between union and structure. In this article you will see why union is different than structure. Lets start with example, Take one union and one structure data types with similar definition.   struct SStudent { int age; float height; double phone; }; union UStudent { int age; … Continue Reading….

Posted in: C/C++ Tagged: C, Pointers, struct, union

What is Union in C/C++

May 20, 2015 / Leave a Comment

Union is another user defined data type with some unique characteristics. Union is a sibling of structure. In previous articles you have read What is Structure in C/C++ If you have not read this article, it is highly recommended to understand structure first, then you can understand what is the difference between union and structure. Union is … Continue Reading….

Posted in: C/C++ Tagged: C, Pointers, struct, union

Nested Structure in C/C++

May 20, 2015 / 2 Comments

struct Student { char course[20]; int ID; long phone; }; Suppose you have one structure Student with some basic information and you want to add more variables in it. You can add these new variables in the same structure and it will solve your problem but there are some drawbacks with this technique, one is, … Continue Reading….

Posted in: C/C++ Tagged: C, nested structure, Pointers, struct, union

Pointer to Structure in C/C++

May 20, 2015 / Leave a Comment

When you initialize any variable, it occupies some space in memory and you can access this variable by using pointers. For integer, you use pointer to integer, for float, you use pointer to float.  Structures are also your defined variables. Structures also take some space in memory and by using pointers to structure, you can access the address … Continue Reading….

Posted in: C/C++ Tagged: C, Pointers, struct, union

Unnamed structures in C/C++

May 20, 2015 / Leave a Comment

In previous articles Initialization of structure What is Structure in C/C++ you have learned how to create a normal structure struct Student { char name[20]; int ID; int age; float phone; }; how to initialize instance of structure  in different ways. struct Student { char name[20]; int ID; int age; float phone; }std3,std4,std5; Student std1, std2; and how … Continue Reading….

Posted in: C/C++ Tagged: C, Pointers, struct, union

Search here:

Recent Posts

  • How Kotlin handles variables
  • Python a quick introduction
  • What is Metadata
  • Git : On Your Finger Tips
  • Swift Fundamentals: An introduction
December 2019
M T W T F S S
« Jul    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Copyright © 2019 Understand Programming.

Me WordPress Theme by themehall.com.