#include<stdio.h>
int main()
{
struct MyBookPrice//tag
{
int bookid; //struct member1
int price; //struct member2
char pubdate; //struct member3
}bookstruct;
//assign value to the struct..
bookstruct.bookid;
bookstruct.price;
bookstruct.pubdate;
printf("\nGive new value to book ID: ");
scanf("%d",&bookstruct.bookid);
printf("\nGive new value to book Price: ");
scanf("%d",&bookstruct.price);
printf("\nGive new value of book Published Date: ");
scanf("%s",&bookstruct.pubdate);//should be like 20/12/2017
//accessing and display struct
printf("\n New Labell = %d",bookstruct.bookid);
printf("\n New Label2 = RM%d",bookstruct.price);
printf("\n New Label3 = %s",bookstruct.pubdate);
system("pause");
return 0;
}
hi guys, well from the above code..i can execute the program...and i can enter the scanf value for bookstruct.bookid, bookstruct.price, & book.pubdate successfully...but when it goes down to display the data back...its only showed me the value for bookstruct.bookid and bookstruct.price and..finally crashed..without showing the value of bookstruct.pubdate..
between im using dev-C++5.11..can u guys help me out here...am i wrong somewhere..thx in advance ya..