The type definitions are usually in a header file where no vars are created.
In your main(), you are supposed to use this type to create vars. In our example, the newly minted type is 'Scanner'.
#include <stdio.h>
#include <stdlib.h>
struct _scanner
{ // example
int a;
double b;
char c;
};
typedef struct _scanner Scanner;
int main()
{
Scanner s;
s.a = 10;
s.b = 3.14;
s.c = 'N';
// -------------------
// If you want to have a
// pointer p to scanner, then
Scanner* p = &s;
p->a = 20;
p->b = 2.72;
p->c = 'Y';
printf("%d, %.2lf, %c\n",
s.a, s.b, s.c);
return EXIT_SUCCESS;
}
Output:
20, 2.72, Y
Once the variable is created, you can make a pointer to it, as a pointer must be able to point to something. The output shows that values have been successfully manipulated.