Witam ma problem z programem. Po wpisaniu jednego z kilku punktów program się wyłącza. Dopiero zacząłem ze wskaźnikami.
#include <iostream>
struct points {
char *letter;
int *A;
int *B;
};
void comparison (points &tabPoints);
int main()
{
int step = 0;
int howManyPoints = 0;
int index = 0;
std::cin >> step >> howManyPoints;
// std::cout << step << howManyPoints << std::endl;
points * tabPoints = new points [howManyPoints];
while (step != 0) {
// std::cout << "robi " << std::endl;
while (howManyPoints != 0) {
std::cin >> *tabPoints[index].letter >> *tabPoints[index].A >> *tabPoints[index].B;
++index;
--howManyPoints;
}
--step;
}
size_t size = (sizeof (tabPoints)/sizeof (tabPoints[0]));
std::cout << size << std::endl;
for (int i = 0 ; i < size ; ++i) {
std::cout << *tabPoints->letter << *tabPoints->A << tabPoints->B << std::endl;
}
delete [] tabPoints;
return 0;
}
void comparison (points &tabPoints) {
}