-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSong.h
More file actions
41 lines (29 loc) · 814 Bytes
/
Song.h
File metadata and controls
41 lines (29 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef SONG_H
#define SONG_H
#include <iostream>
using namespace std;
using namespace std;
// Song is a simple class that stores a title and artist as strings
// it just provides i/o operators, == operator, constructors and Set function
class Song
{
// output the song in the format:
// title, artist
friend ostream &operator<<(ostream &os, const Song &song);
// input the song in the format:
// title, artist
friend istream &operator>>(istream &is, Song &song);
// compare two song objects for equality
friend bool operator==(const Song &lhs, const Song &rhs);
public:
// constructors
Song();
Song(const char *t, const char *a);
// set the song
void Set(const char *t, const char *a);
private:
static const int MAX_CHARS = 64;
char title[MAX_CHARS];
char artist[MAX_CHARS];
};
#endif