Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created July 13, 2019 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/2772f4da7de29d0e0b7282afcaae42da to your computer and use it in GitHub Desktop.
Save codecademydev/2772f4da7de29d0e0b7282afcaae42da to your computer and use it in GitHub Desktop.
Codecademy export
#include <iostream>
#include "song.hpp"
int main() {
Song electric_relaxation;
electric_relaxation.add_title("Electric Relaxation");
std::cout << electric_relaxation.get_title();
}
#include "song.hpp"
// add Song method definitions here:
void Song::add_title(std::string new_title) {
title = new_title;
}
std::string Song::get_title() {
return title;
}
#include <string>
// add the Song class here:
class Song {
std::string title;
public:
void add_title(std::string new_title);
std::string get_title();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment