Deep C Dives: Value Structs
Written by Mike James   
Wednesday, 27 August 2025
Article Index
Deep C Dives: Value Structs
Value Semantics
Padding
Final Thoughts

Final Thoughts

In many ways the C struct is the key data structure in C and it is so much more than just an implementation of a data record found in other languages. It is central to the idea that C deals with bits as it is structs that let you determine what the bits mean. This is obvious to any programmer using C for the sort of tasks it was designed for – systems programming and hardware programming. Unfortunately, this is not a view shared by the programmers on the standards committees and the compiler writers, who in the main strive to make C look like a modern language and try to make it easier to optimize the code. This goes against the low-level appeal of structs and type punning in general and even makes them seem undesirable and dangerous.

For a fuller discussion, see Dive 16 which deals with the scandal of undefined behavior.

Deep C Dives
Adventures in C

By Mike James

Cdive360

Buy from Amazon.

Contents

Preface
Prolog C
Dive

  1. All You Need Are Bits
  2. These aren’t the types you’re looking for
  3. Type Casting
  4. Expressions
  5. Bits and More Bits
        Extract:
    Bits!
  6. The Brilliant But Evil for 
  7. Into the Void 
  8. Blocks, Stacks and Locals
  9. Static Storage
  10. Pointers
  11. The Array and Pointer Arithmetic
  12. Heap, The Third Memory Allocation
  13. First Class Functions
        Extract:
    First Class Functions
  14. Structs and Objects
        ExtractValue Structs ***NEW!
  15. The Union
  16. Undefined Behavior
  17. Exceptions and the Long Jump

<ASIN:B0D6LZZQ8R>

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Panic Over Arduino Ts and Cs
26/11/2025

It could have been good news that Qualcomm had taken over Arduino. Adding its financial muscle and processor resources to the very popular development environment could have, and still could, produce  [ ... ]



Google Launches Colab Extension For Visual Studio
02/12/2025

Google has launched a new Google Colab extension for Visual Studio Code. Colab is Google's platform for AI/ML development. 


More News

pico book

 

Comments




or email your comment to: comments@i-programmer.info



Last Updated ( Wednesday, 27 August 2025 )