There isn't a single webpage that explains how I can use make struct like this and can only find an example in my book. So I'm trying it out and it wont save or print anything at all.
//array struct?
#include <stdio.h>
#include <string.h>
struct testing
{
int a;
int b;
char c[5];
} t[3];
void main()
{
struct testing;
t[1].a = 10;
t[1].b = 20;
strcpy("thing", t[1].c);
printf("%d %d %s", t[1].a, t[1].b, t[1].c);
}
as you can see, t[1].a
is suppose to store 10. That printf
doesn't print a single thing. Am I doing this wrong?