[Solved] Using “->” instead of “.” to access structure gives Segmentation Fault
somestruct *mystruct defines a pointer to memory of type somestruct and does not point to anything, or better if it is local variable then it is not initialized and this is Undefined Behaviour. If you do this somestruct mystruct then you define struct itself and not a pointer (object exists in memory). To use pointer … Read more