witam, piszę kod w c++ builder i pisząc konstruktora do danej klasy otrzymuję błędy
[C++ Error] Unit1.cpp(38): E2108 Improper use of typedef 'string'
[C++ Error] Unit1.cpp(38): E2293 ) expected
nie mogę sobie poradzić z odszyfrowaniem tego więc byłbym bardzo szczęśliwy, gdyby ktoś spojrzał na to i może powiedział co mam źle
plik.cpp
//---------------------------------------------------------------------------
#include <tchar.h>
#include <vcl.h>
#pragma hdrstop
#include <iostream>
#include <string>
#include <fstream>
#include "Unit1.h"
#include <cstdlib>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1* Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
string linia;
string a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, r, s, t, u;
using namespace std;
fstream miejsce_lok;
void uzytkownicy::wczytaj()
{
miejsce_lok.open("wskaznik.txt", ios::in);
if (miejsce_lok.good() == false)
;
{
MessageBox(NULL, "plik wskaznik istnieje, nie możliwe jest uruchomienie dalej systemu",
"wiadomosc", MB_ICONINFORMATION | MB_OK);
terminate();
}
string miejsce;
getline(miejsce_lok, miejsce);
miejsce_lok.close();
uzytkownicy::uzytkownicy(string im, string naz, string has, string adm)
{
imie = im;
nazwisko = naz;
haslo = has;
adm = admin;
}
plik.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <iostream>
using namespace std;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published : // IDE-managed Components
private : // User declarations
public : // User declarations
__fastcall TForm1(TComponent* Owner);
};
class uzytkownicy
{
string imie, nazwisko, haslo, admin;
uzytkownicy(string = "brak", string = "brak", string = "1111", string = "tak");
public:
void wczytaj();
void pokaz();
~uzytkownicy();
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1* Form1;
//---------------------------------------------------------------------------
#endif