#include <iostream>
#include <cstring>
using namespace std;

class Genre {
    struct Genres {
        string name;
        string description;
    };
    
    using pGenres = Genres*;
    
    int index = 0;
public:
    pGenres* genres = nullptr;
    
    Genre() {}
    ~Genre() { 
    	if (index == 0) return;
    	
		for(int i = 0; i<index; i++){
			delete genres[i];
		}
		delete[] genres;
    }
	void addGenre(string name, string desc){
		// string good_name = this->goodLetters(name);
		string good_name = name;
		
	    auto new_genres = new pGenres[index+1];
	    if (genres){
	    	memcpy(new_genres, genres, index * sizeof(pGenres));
	    }

	    new_genres[index] = new Genres;
	    new_genres[index]->name = good_name;
	    new_genres[index]->description = desc;

	    if (genres){
	    	delete[] genres;	
	    } 
	    
	    genres = new_genres;
	    index++;
	}
	void print(){
		cout << "print:" << endl;
		for(int i=0; i<index; i++){
			cout << i << " :: " << genres[i]->name << " :: " <<  genres[i]->description << endl;
		}
	}
};

int main() {
	// your code goes here
	Genre genre;
	genre.addGenre("Name1", "Desc1");
	genre.addGenre("Name2", "Desc2");
	genre.print();
	return 0;
}