Cześć
Na starcie, nie jestem jakims zaawansowanym, ale tez nie żółtodziobem :)Pisze program cos ala quiz. Stwierdziłem że skorzystam z nagłówkowych dla wiekszej czytelności.Przed rozbiciem wszystko dziala. Po rozbiciu, w Code blocksie sie kompliluje zwracajac w build logu "Process terminated with status -1073741510". W visualu wywala błąd od razu. Niestety nie jestem w stanie go znaleźć i też nie wiem za bardzo gdzie go szukać. Byłbym bardzo wdzieczny za pomoc. A chce pisac w visualu bo wygodniej. Dodatkowo ten błąd mnie martwi
main
#include <iostream>
#include <fstream>
#include <string>
#include<ctime>
#include<cstdlib>
#include"funkcje.h"
using namespace std;
class zadanie {
string pytanie;
string odpowiedz;
zadanie() {
pytanie = "blad";
odpowiedz= "blad";
}
};
class plik {
int dlugosc;
string nazwapliku;
plik() {
nazwapliku = "text.txt";
ifstream dane(nazwapliku, ios::in);
if (dane.good()) {
dlugosc = 0;
string bufor;
if (dane.good()) {
while (getline(dane, bufor)) {
++dlugosc;
}
dane.close();
}
}
}
plik(string n) {
nazwapliku = n;
dlugosc = 0;
}
};
int main()
{
srand(time(NULL));
cout << "hellaaaao";
return 0;
}
#include <iostream>
#include <fstream>
#include <string>
#include<ctime>
#include<cstdlib>
#include"funkcje.h"
using namespace std;
int losowanie(int length) {
//do usuniecia, do testow losowan
int los = rand() % (length / 2);
ifstream dane("losy.txt", ios::out);
dane >> los;
dane.close();
return los;
//koncowe
//return los = rand() % (length / 2);
}
void przesuwanie_glowicy(int length, ifstream& data) {
string bufor;
data.seekg(0);
for (int i = 0; i < 2 * losowanie(length); i++) {
getline(data, bufor);
}
}
#ifndef FUNKCJE_H_INCLUDED
#define FUNKCJE_H_INCLUDED
int losowanie(int);
void przesuwanie_glowicy(int, ifstream&);
#endif // FUNKCJE_H_INCLUDED