I wrote this program but it does not return the information i want it excutes fine but it does not return what i want it to.
Code:
#include <stdio.h>
typedef struct{
int number;
int place;
int postcode;
} information_t;
int test(information_t *in);
int main()
{
information_t information;
information_t *in;
printf(" Please enter the number: ");
scanf(" %d",&information.number);
printf(" Please enter the place: ");
scanf(" %d",&information.place);
printf(" please enter the postcode: ");
scanf(" %d",&information.postcode);
test(in);
return 0;
}
int test(information_t *in)
{
int position;
position= printf(" The number is %d the place is %d and the postcode is %d\n", &in->number, &in->place, &in->postcode);
//printf(" The number is %d the place is %d and the postcode is %d\n", &in->number, &in->place, &in->postcode);
return(position);
}