Grading & Assignment Submissions on PrairieLearn
C++ gives us:
.h, .cpp, and .hpp, and grouping of related code in files)//Include this file only once
#pragma once
namespace cs225{
class Cube {
public:
double getVolume();
private:
double length_;
};
}
#include "Cube.h"
namespace cs225{
double Cube::getVolume() {
return length_*length_*length_;
}
}
Used to separate and organize various sets of objects and functions. e.g. std is the standard namespace.