The link from raddevus is probably exactly the right explanation (my 5 for it).
A glance at the beginning is enough to accept the suspected error.
struct star s[201][201];
int cont = 0, m, n;
fin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
fin >> s[i][j].in;
}
}
1.Without the content of the file "patrat2.in" nothing happens. What is the content of the file?
2.Obviously a matrix is being filled. In which dimension and which data does the problem arise? I tested small values with no problems ...
3.Arrays start at 0 in C and C ++. Then why do the for loops start at 1?
4.Reading files without recognizing errors doesn't make a lot of sense.
5.If the dimensions of the matrix are known, it would make sense to create the required memory dynamically.