Witam. Mam problem a mianowicie chce wczytać z pliku tekstowego do Caption Label1. Niestety nie moge.
Oto kod:
#include <vcl.h>
#pragma hdrstop
#include <fstream>
#include <cstdlib>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int s;
fstream plik;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
plik.open("plik.txt", ios::in, ios::out);
string linia;
int nr;
nr=1;
while(getline(plik,linia))
{
switch(nr)
{
case '1': s=linia;
}
}
}
//---------------------------------------------------------------------------
Czy mógł by mi ktoś powiedzieć co tu nie gra?