Help me, I'm not good at this stuff

Help, I'm fairly new to C++ and really having trouble understanding the whole thing. For this program I'm supposed to design and implement a C++ class to store information about a movie that I get from a csv file. I'm also supposed to implement a tester program that loads. I have the tester program below and it keeps giving me issues with my vector and my destructor. I am completely lost right now. If I'm doing a bad job of explaining, I'm sorry, just let me know and I'll try to reexplain myself.
[code]

#include <iostream>
#include "Movie.h"
#include <fstream>
#include <vector>
#include <sstream>
using namespace std;

void loadData();
void printMovies(vector<Movie*> list);

void findTopMovies();
vector<Movie*> findBetterMovies(Movie *m);
void freeMemory();

//Variables
int mid;
int myear;
double mrating;
vector<Movie*>mv;
string title;


vector<Movie*> movies;
vector<Movie*> topMovies;

int main()
{
loadData();
printMovies(vector <Movie*> list);
}


void loadData()
{

ifstream inFile;
string data;
string filename = "movies.csv";

inFile.open("movies.csv");

if (!inFile) // Error Message
{
cout << "File cannot be found!" << endl;
exit(1);
}

cout << "Data is loading...." << endl;

while (getline(inFile, data))
{
stringstream check(data);

string id, title, year, rating; // Movie names

getline(check, id, ',');
getline(check, title, ','); // Tokenizing Statements;
getline(check, year, ',');
getline(check, rating, '\n');

int mid = stoi(id);
int myear = stoi(year);
double mrating = stod(rating);


Movie* mv = new Movie(mid, title, myear, mrating);
movies.push_back(mv);




}

inFile.close();

cout << "Data loading is completed" << endl;
}
void printMovies(vector<Movie*> list)
{
Movie* mv = new Movie(mid, title, myear, mrating);

movies.push_back(mv);
cout << *mv;

}




void findTopMovies()
{
vector<Movie> list;

}


void freeMemory()
{
~Movie();


}
It is giving me errors like that no operator matches the "~" operand. And that printMovies(vector<Movie*>); is not an allowed type name.
the header file:

#ifndef MOVIE_H
#define MOVIE_H

#include <string>
using namespace std;

class Movie
{
private:
int id, year;
string title;
double rating;

public:
Movie(int id, string title, int year, double rating);
~Movie();

int getId() const;
int getYear() const;
double getRating() const;
void setTitle(string title);
void setId(int id);
void setYear(int year);
void setRating(double rating);

// Do friend functions here
friend bool operator<(const Movie& ihs, const Movie& rhs);

friend ostream& operator<<(ostream& ostr, const Movie& m); // Follow UML for naming standards.



};


#endif
the Movie.cpp file:

#include "Movie.h"
#include <iostream>
#include <string>


using namespace std;
// No int main in function implementation cpp file

Movie::Movie(int id, string title, int year, double rating)
{
this->id = id;
this->title = title;
this->rating = rating;
}
Movie::~Movie()
{
cout << "DESTRUCTOR IS CALLED" << endl;
}
int Movie::getId() const
{

return id;


}

void Movie::setId(int id)
{
this->id = id;
}
bool operator<(const Movie& ihs, const Movie& rhs)
{
if (ihs.year != rhs.year)
{
return ihs.rating < rhs.year;
}
else
{
return ihs.rating < rhs.rating;
}
}
ostream& operator<<(ostream& ostr, const Movie& m)
{
ostr << m.id << ", " << m.title << ", "
<< m.year << ", " << m.rating << ", " << endl;
return ostr;
}
1) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

2)
It is giving me errors like that no operator matches the "~" operand.

You don't call a destructor explicitly, like you're doing. It's called automatically when an object is destroyed.

3)
And that printMovies(vector<Movie*>); is not an allowed type name.

Look at where you're calling that function. That's not the right syntax for calling a function. You obviously know the correct syntax, because you do it right elsewhere.
Thank you for the help. I'll remember the code tags if I ever need to ask for help again.
You're welcome - hope it helped!
Topic archived. No new replies allowed.