In C, the only operation that can be applied to struct variables is assignment. Any other operation (e.g. equality check) is not allowed on struct variables.
For example, program 1 works without any error and program 2 fails in compilation.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Bit Fields in C
- Structure Sorting (By Multiple Rules) in C++
- Structure Member Alignment, Padding and Data Packing
- Struct Hack
- Structures in C
- Program to Find the Largest Number using Ternary Operator
- Passing Reference to a Pointer in C++
- How to avoid Structure Padding in C?
- wcrtomb() function in C/C++
- vswprintf() function in C/C++