Od razu mówię że bawię się z c++ może 10h na razie.
Moim problemem jest to że w linijce [komentarz] wyskakuje błąd. Moim celem było zapisanie całej zawartości struktury do pliku [coś ala zapisywanie tablicy typów w pascalu]. Niestety nie jestem w stanie wymyślić dlaczego mam taki błąd. Ktoś mógłby mi ktoś wytłumaczyć czemu jest taki błąd?:p [tylko bez odsyłania do jakiegoś kursu bo mam otwarty jeden na zakładce i tak czy siak nie umiem dojść do tego]
#include <fstream>
#include <cstdio>
#include <iostream>
#include <string>
#include <stdlib.h>
const int maxitem = 99;
const std::string item_file = "D:\\_CO\\_alfa\\item.dat";
struct spell
{
std::string spell_name;
int spell_level;
int spell_type;
int spell_atk;
int spell_heal;
int spell_buff;
int spell_class;
int spell_mc;
};
int spell_()
{
spell spell_list[maxspell];
std::fstream plik( mob_file.c_str(), std::ios::in | std::ios::out );
plik.write( spell_list[0], spell.spell_name ); // error: expected primary-expression before '.' token
}