noxiouzz
Lieutenant
- Registriert
- Aug. 2011
- Beiträge
- 818
Huhu 
Hab hier ein Problem bei der Übergabe und Rückgabe von Strings. Bekomme diese Meldung:
"main.cpp|30|error: no matching function for call to 'Application::Load(std::string&)'|"
Hier mein Quelltext:
main.ccp
Application.h
Application.ccp
Hier nur der interessante Teil
Hat jemand ne Ahnung woran es liegt? Bin eh schon voll verwirrt vom String :O

Hab hier ein Problem bei der Übergabe und Rückgabe von Strings. Bekomme diese Meldung:
"main.cpp|30|error: no matching function for call to 'Application::Load(std::string&)'|"
Hier mein Quelltext:
main.ccp
Code:
#include <string>
#include "Application.h"
using namespace std;
int main()
{
int documents = 7;
string path = "", folder = ".\\", dataname[documents], text[documents];
for (int i = 0; i < documents; i++)
{
text[i] = "";
}
dataname[0] = "a";
dataname[1] = "b";
dataname[2] = "c";
dataname[3] = "d";
dataname[4] = "e";
dataname[5] = "f";
dataname[6] = "g";
Application *application = new Application;
for (int i = 0; i < documents; i++)
{
path = folder + dataname[i];
text[i] = application->Load(path);
}
delete application;
}
Application.h
Code:
#ifndef APPLICATION_H
#define APPLICATION_H
#include <string>
using namespace std;
class Application
{
public:
Application();
virtual ~Application();
string text;
string Load (string path);
void Save ();
protected:
private:
};
Application.ccp
Hier nur der interessante Teil
Code:
#include "Application.h"
using namespace std;
Application::Application()
{
text = "";
}
Application::~Application()
{
}
string Application::Load(string path)
{
return text;
}
Hat jemand ne Ahnung woran es liegt? Bin eh schon voll verwirrt vom String :O
Zuletzt bearbeitet: