CS 1337 Lecture Notes - Lecture 6: Semicolon
Document Summary
}; //semi-colon required int studentid; string name; float gpa; // description : hello world in c++, ansi-style. #include using namespace std; struct student void printclass(const responsibilityclass &aclass); Instructor whoistheteacher(); int main() { struct responsibilityclass string meetingtime; string classroom; //member access operator cout << me. studentid << endl; int scores[100]; responsibilityclass spring2018; //are variables that are a type of some structure. //we have to copy the members and this can be a lot of bytes. //also could pass by reference to avoid this inefficiency (use &) //introduces new problem because now the function can change the value of the spring2018. teach. name = brandenburg; //first access teach in. //like any other variable, a variable that is a structure has a location in. Instructor *instptr; instptr = &a; //contains address of a, an instructor variable. //we need to dereference the pointer to get the actual structure, then use the. //member access operator has higher precedence than indirection operator.