What is the point behind unions in C?
问题 I'm going through O'Reilly's Practical C Programming book, and having read the K&R book on the C programming language, and I am really having trouble grasping the concept behind unions. They take the size of the largest data type that makes them up...and the most recently assigned one overwrites the rest...but why not just use / free memory as needed? The book mentions that it's used in communication, where you need to set flags of the same size; and on a googled website, that it can