So i went back and did some reading but I am still confused on the use of typedef vs. tag, when do I need an Alias for the struct, and do not have a clue how to use a pointer to the struct.I cannot get the below to work. Any help would be appreciated.
Code:
#ifndef PRINT_ART
#define PRINT
#define STR_LEN 20
struct Article{
int number;
int quantity;
char description[STR_LEN+1];
};
void PRINT(struct Article art_1);
{
printf("Number:%d\n", art_1->number);
printf("Quantity:%d\n", art_1->quantity);
printf("Desciption:%s\n", art_1->description);
}
#endif
Code:
#include <stdio.h>
#include "header.h"
int main()
{
struct Article art_1 ={56577,65,"Intro to Stuct"};
struct Article art_2 ={56568,88,"Intro to Stuck"};
PRINT (art_1);
}