Witam
Mam taki kod:
[code]#include "stdafx.h"
#include <iostream>
#include <fstream>
#include "conio.h"
#include <string>
using namespace std;
struct struktura{
int wiek;
string imie;
string nazwisko;
};
int main()
{
struktura student;
string tresc,linia;
ifstream plik("dane.txt");
if(plik)
{
while (getline(plik, tresc))
{
cout <<tresc<<"\n";
}
} else cout << "Nie udalo otworzyc sie pliku!" << endl;
struktura dane;
plik >> dane.wiek >> dane.imie >> dane.nazwisko;
plik.close();
getch();
}[/code]
Chodzi mi o to, aby dane zawarte w pliku (wiek) wyświetlić. Tak samo postąpić z wczytanymi danymi z pliku. Tak, aby je wyświetlić.
Proszę o pomoc!