structs
On this page
This lesson contains approximately 20 minutes of video content.
structs
Writing structs in C++
In this exercise, define the type Student using a struct declaration. Your Student type must have three data members: first_name, last_name, and uin typed std::string, std::string, unsigned int respectively.
It is important to note that until you have correctly defined the data members for Student, your program will not compile with our test suite. Therefore, we encourage you to write test statements in your driver.cc and then use the "Run" button to observe the output. Also, don't forget what you need to #include to use an std::string.
#ifndef STUDENT_HPP
#define STUDENT_HPP
#endif
#include "student.hpp"
#include "student.hpp"
int main() {
}
> Click Run to compile and run your code.