20 IntelliSense: too few arguments in function call c:\Users\Dylan\Documents\Visual Studio 2013\Projects\Robot Masters - Text\code\basic.cpp 77 17 Robot Masters - Text
Error 9 error C2660: 'Basic::Welcome' : function does not take 1 arguments c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\main.cpp 13 1 Robot Masters - Text
Error 10 error C2660: 'Basic::FunctionCaller' : function does not take 1 arguments c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\main.cpp 14 1 Robot Masters - Text
Error 11 error C2660: 'Basic::AutoSave' : function does not take 1 arguments c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\main.cpp 15 1 Robot Masters - Text
Error 4 error C2511: 'void Shop::Temp(Local &)' : overloaded member function not found in 'Shop' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\shop.cpp 21 1 Robot Masters - Text
Error 15 error C2511: 'void Basic::Welcome(Local &)' : overloaded member function not found in 'Basic' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.cpp 17 1 Robot Masters - Text
Error 17 error C2511: 'void Basic::FunctionCaller(Shop &)' : overloaded member function not found in 'Basic' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.cpp 24 1 Robot Masters - Text
Error 19 error C2511: 'void Basic::AutoSave(Local &)' : overloaded member function not found in 'Basic' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.cpp 81 1 Robot Masters - Text
Error 18 error C2352: 'Basic::Help' : illegal call of non-static member function c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.cpp 38 1 Robot Masters - Text
Error 16 error C2352: 'Basic::GetStartBalance' : illegal call of non-static member function c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.cpp 18 1 Robot Masters - Text
Error 6 error C2061: syntax error : identifier 'Shop' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 11 1 Robot Masters - Text
Error 13 error C2061: syntax error : identifier 'Shop' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 11 1 Robot Masters - Text
Error 1 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\shop.h 5 1 Robot Masters - Text
Error 2 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 10 1 Robot Masters - Text
Error 3 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 13 1 Robot Masters - Text
Error 5 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 10 1 Robot Masters - Text
Error 7 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 13 1 Robot Masters - Text
Error 8 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\shop.h 5 1 Robot Masters - Text
Error 12 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 10 1 Robot Masters - Text
Error 14 error C2061: syntax error : identifier 'Local' c:\users\dylan\documents\visual studio 2013\projects\robot masters - text\code\basic.h 13 1 Robot Masters - Text
main.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include "basic.h"
#include "quest.h"
#include "shop.h"
#include "workshop.h"
#include "local.h"
int main()
{
Local local;
Basic basic;
Shop shop;
basic.Welcome(local);
basic.FunctionCaller(shop);
basic.AutoSave(local);
std::cout << "" << std::endl; // Testing only
system("pause"); // Testing only
return 0;
}
|
basic.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <iostream>
#include <fstream>
#include <string>
class Basic
{
void Help();
int GetStartBalance();
public:
void Welcome(Local& local);
void FunctionCaller(Shop& shop);
void ShowInventory();
void AutoSave(Local& local);
};
|
shop.h
1 2 3 4 5 6 7 8 9
|
class Shop
{
public:
void DisplayShop();
void Temp(Local& local);
private:
void BuyItem();
void SellItem();
};
|
local.h
1 2 3 4 5
|
class Local
{
public:
int balance;
};
|
basic.cpp
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#include "basic.h"
#include "local.h"
#include "shop.h"
int Basic::GetStartBalance()
{
std::ifstream save("save.txt");
int newBalance;
save >> newBalance;
save.close();
return newBalance;
}
void Basic::Welcome(Local& local)
{
local.balance = GetStartBalance();
std::cout << "Welcome to Robot Masters" << std::endl;
std::cout << "Balance: $" << local.balance << std::endl << std::endl;
}
void Basic::FunctionCaller(Shop& shop)
{
std::string call;
std::string function = "What function do you want to call?";
std::string help = "Hint: type 'help' for a list of avalible functions";
bool check = true;
std::cout << function << std::endl << help << std::endl;;
std::cin >> call;
std::cout << "" << std::endl;
while (check == true)
{
if (call == "help")
{
Help();
check = false;
}
else if (call == "shop")
{
shop.DisplayShop();
check = false;
}
else if (call == "home")
{
std::cout << "You are already at the menu" << std::endl;
std::cout << function << std::endl << help << std::endl;
std::cin >> call;
std::cout << "" << std::endl;
check = true;
}
else
{
std::cout << function << std::endl << help << std::endl;
std::cin >> call;
std::cout << "" << std::endl;
check = true;
}
}
}
void Basic::Help()
{
std::ifstream HelpFile("help.txt");
std::string line;
while (getline(HelpFile, line))
{
std::cout << line << std::endl;
}
std::cout << "" << std::endl;
FunctionCaller();
}
void Basic::AutoSave(Local& local)
{
std::ofstream save("save.txt");
save << local.balance << std::endl;
}
void Basic::ShowInventory()
{
// TODO
}
|
shop.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include "shop.h"
#include "basic.h"
#include "local.h"
void Shop::DisplayShop()
{
//TODO
}
void Shop::BuyItem()
{
//TODO
}
void Shop::SellItem()
{
//TODO
}
void Shop::Temp(Local& local)
{
local.balance = 145;
}
|
So many errors and I dont know why!