Question: C language (2.6) struct location t char *name; float lat; float lon; 3; int mainO struct location myHouse; struct location *DC; DC (struct location*) malloc(sizeof(struct

C language

(2.6)

C language (2.6) struct location t char *name; float lat; float lon;

struct location t char *name; float lat; float lon; 3; int mainO struct location myHouse; struct location *DC; DC (struct location*) malloc(sizeof(struct location)); DC->name = "Washington DC". DC->lat = 38.889404; DC->lon77.035194; myHouse.name = "Prof. Wood's Igloo''. myHouse.lat 77.828029; myHouse.lon --88.057823; printf("I live at %f, %f ", myHouse .Tat, myHouse.lon) ; printf("I commute to %f, %f ", DC->lat, DC->lon); Exercise 2.6: Implement the above in structExaple.c. Define another pointer based location struct called myHousePtr and make it point to the myHouse variable. Add another print statement that outputs the values for your new struct. What errors do you get if you try to use the wrong operator to access either a pointer or non-pointer based stack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!