structs
This lesson contains approximately 20 minutes of video content.
structs
Writing structs in C++
Activity: struct Student
Graded Playground Autograder
Activity Prompt:
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() {
}
Submit is not supported in this site.