I took into account what y'all had to say and made some changes, but I still can't get it to run. Whenever I try, I get the following error messages:
Error (active) E0065 expected a ';' ConsoleApplication2 16
Error (active) E0415 no suitable constructor exists to convert from "const char [1]" to "Piano" ConsoleApplication2 17
Error (active) E0169 expected a declaration ConsoleApplication2 18
Error (active) E0070 incomplete type is not allowed ConsoleApplication2 23
Error (active) E0020 identifier "filename" is undefined ConsoleApplication2 23
Error (active) E0135 class "Piano" has no member "LoadNotes" ConsoleApplication2 28
Error C2143 syntax error: missing ';' before '}' ConsoleApplication2 16
Error C2440 'initializing': cannot convert from 'const char [1]' to 'Piano' ConsoleApplication2 17
Error C2447 '{': missing function header (old-style formal list?) ConsoleApplication2 18
Error C2079 'input_file' uses undefined class ConsoleApplication2 23
Error C2065 'filename': undeclared identifier ConsoleApplication2 23
Error C2039 'LoadNotes': is not a member of 'Piano' ConsoleApplication2 28
Error C2731 'main': function cannot be overloaded ConsoleApplication2 32
Error C4996 'getch': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _getch. See online help for details. ConsoleApplication2 36
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
|
#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <windows.h>
using namespace std;
class Piano
{
//Member variables
private:
string notes;
//Member functions
public:
//default constructor
Piano();
}
notes = "";
{
//Load notes from file
void LoadNotes(string filename)
}
char note;
ifstream input_file(filename);
int main()
{
Piano p;
p.LoadNotes("filenmae");
}
|