Struct in C++

p[0].a equals 30, and p[0].b equals 50. p[1].a equals 10, and p[1].b equals 40.
In the main memory, the integer takes up 4 bytes of space, the double takes up 8 bytes of space, and the string takes up 20 bytes of space. Union takes up as much space in main memory as the string that takes up the most space. However, union takes up 24 bits, since double takes up 8 bits. Union would take up 20 bits of space, if it were float instead of double.

--

--

--

Computer Engineering student

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building GUI Container On The Docker..

Configure Liveness Probe in Kubernetes

A Groovy Kind of Relationship

From “Roughcast House” to “Fine-Decoration House” — Enterprise IT Governance Solutions for…

Convert Spreadsheet Data To Dashboards With DashboardFox LiftOff Service

AN INTRODUCTION TO WEB DESIGN USING HTML CODES

What makes you an expert Python developer?

what makes you an expert python developer?

North-South Traffic Management of Istio Gateways (with Answers from Service Mesh Experts)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yağmur Kocabıyık

Yağmur Kocabıyık

Computer Engineering student

More from Medium

Control Statements in C

C++ 20 Addition : constinit specifier

Compilation in C

What does IT guys mean by “IDEMPOTENCE ”?