How to make a .h file on a macbook? [closed]

19 hours ago 1
ARTICLE AD BOX

I am trying to make a 3-part C++ program, but I do not know how to make one of the files a .h file. If someone wouldn't mind, could I just put the C++ code below and you give me the .h file?

#ifndef CAR_H #define CAR_H #include <string> using namespace std; class Car { private: int year; int speed; string make; public: // Constructor Car(int carYear, string carMake); // Accessors int getYear() const; int getSpeed() const; string getMake() const; // Mutators void setYear(int carYear); void setSpeed(int carSpeed); void setMake(string carMake); // Other functions void accelerate(); void brake(); }; #endif
Read Entire Article