Hallo, versuch mich grad an meinem ersten C++ Programm und hab ein Problem. Führe ich folgendes Programm aus, bekomm ich
11 main.cpp conflicting declaration 'ECSDialog Filename'
9 main.cpp 'Filename' has a previous declaration as `char Filename[20]'
11 main.cpp declaration of `ECSDialog Filename'
9 main.cpp conflicts with previous declaration `char Filename[20]'
11 main.cpp no matching function for call to `ECSDialog::ECSDialog()'
candidates are: ECSDialog::ECSDialog(const ECSDialog&:wink:
ECSDialog::ECSDialog(char\*)
Der Code:
main.cpp:
#include
#include
#include "ecsdialog.h"
using namespace std;
int main(int argc, char \*argv[]){
char Filename[20];
strcpy("1.log",Filename);
ECSDialog(Filename);
system("PAUSE");
return EXIT\_SUCCESS;
}
ecsdialog.h:
#include
#include
using namespace std;
class ECSDialog{
private:
char s\_zeile[256];
public:
ECSDialog::ECSDialog(char\* p\_Filename) {
ifstream f\_logfile (p\_Filename);
if( !f\_logfile ) throw "Fehler beim Öffnen!";
cout
lg
fabian