The document describes compile errors occurring in a C++ project for managing a music playlist. There are errors in the Playlist.cpp file related to using the std::list iterator and calling member functions on it. The code is provided for the Main.cpp, Playlist.cpp and Playlist.h files that define the playlist classes and functions. A modified version of the code is also provided that fixes the iterator issues.
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
I am having the below compile errors. .pdf
1. I am having the below compile errors.
*****************************************************************************
******
1>------ Build started: Project: playlist, Configuration: Debug Win32 ------
1> Playlist.cpp
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(74): error
C3867: 'std::list>::size': non-standard syntax; use '&' to create a pointer to member
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(74): error
C2296: '>': illegal, left operand has type 'unsigned int (__thiscall std::list>::* )(void) noexcept
const'
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(74): error
C2297: '>': illegal, right operand has type 'unsigned int (__thiscall std::list>::* )(void) noexcept
const'
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(76): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): error
C2227: left of '->GetID' must point to class/struct/union/generic type
1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(78): note:
type is 'unknown-type'
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): error
C2065: 'it': undeclared identifier
2. 1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): error
C2227: left of '->GetSongName' must point to class/struct/union/generic type
1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(80): note:
type is 'unknown-type'
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(81): error
C2065: 'it': undeclared identifier
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(144):
error C3867: 'std::list>::size': non-standard syntax; use '&' to create a pointer to member
1> with
1> [
1> _Ty=Playlist
1> ]
1>c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(144):
error C2446: '<=': no conversion from 'unsigned int (__thiscall std::list>::* )(void) noexcept
const' to 'int'
1> with
1> [
1> _Ty=Playlist
1> ]
1> c:users rgdocumentsvisual studio 2015projectsplaylistplaylistplaylist.cpp(144):
note: There is no context in which this conversion is possible
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
****************************************************************
I have three files:
Main.cpp
#include
#include "Playlist.h"
using namespace std;
int main()
{
int choice;
string uqid = "";
string songnam = "";
string artname;
int len;
PlaylistNode PlaylistNode;
3. do
{
cout << "MENU" << endl;
cout << "a - Add song: " << endl;
cout << "d - Remove song: " << endl;
cout << "c - Change position of song " << endl;
cout << "s - Output songs by specific artist: " << endl;
cout << "t - Output total time of playlist (in seconds): " << endl;
cout << "o - Output full playlist " << endl;
cout << "q - QUIT PROGRAM " << endl;
cout << "Please enter your selection." << endl;
cin >> choice;
switch (choice)
{
case 'a':
{
cout << "ADD SONG" << endl;
cout << "Enter song's unique ID:" << endl;
cin >> uqid;
cout << "Enter song's name:" << endl;
cin >> songnam;
cout << "Enter artist's name:" << endl;
cin >> artname;
cout << "Enter Song len" << endl;
cin >> len;
Playlist playlistobj(uqid, songnam, artname, len);
PlaylistNode.Addsong(playlistobj);
break; //Add record
}
case 'd':
{
cout << "REMOVE SONG" << endl;
cout << "Enter song's unique ID:" << endl;
cin >> uqid;
PlaylistNode.Removesong(uqid);
4. }
break; //Display record
case 'c':
{
int Creentpos = 0;
int newpos = 0;
cout << "Enter song's current position:" << endl;
cin >> Creentpos;
cout << "Enter new position for song:" << endl;
cin >> newpos;
PlaylistNode.Changeposition(Creentpos, newpos);
}
case 's':
cout << "Enter artist's name:" << endl;
cin >> artname;
PlaylistNode.PrintSongByartist(artname);
break; //EDit record
case 't':
PlaylistNode.PrintSongtotalLen();
break; //EDit record
case 'o':
PlaylistNode.PrintFullPlayList();
break; //EDit record
case 'q':
cout << "QUIT PROGTRAM--" << endl;
break;
default: cout << "Invalid Selection" << endl;
}
} while
(choice == 'q');
system("PAUSE");
return 0;
}
Playlist.cpp
#include "Playlist.h"