- Define a cart structure by the name mycart. Also, define two pointers to structure of the cart structure, ptrcart and ptrcust, as shown in the following code snippet:
struct cart mycart;struct cart *ptrcart, *ptrcust;
- Enter the order number, email address, and password of the customer, and these values will be accepted using the mycart structure variable. As mentioned previously, the dot operator (.) will be used for accessing the structure members, orderno, emailaddress, and password, through a structure variable as follows:
printf("Enter order number: ");scanf("%d",&mycart.orderno);printf("Enter email address: ");scanf("%s",mycart.emailaddress);printf("Enter password: ");scanf("%s",mycart.password);
- Set the pointer to ...