I'm using an UNIX os, the schools, and I'm having trouble literally assigning a value to a structure variable.
Here's the simple code...
#include <stdio.h>
structure example
{
float gpa;
};
typedef struct example Example;
Example number;
int main()
{
number->gpa = 5.65;
return 0;
}
It complies, but when I run it, I get Segmentation fault (core dumped)..
Why does this happen? Please help.
Josh