diff options
1 files changed, 7 insertions, 0 deletions
| -rw-r--r-- | Sem. 03/array_of_students_read.cpp | 7 |
diff --git a/Sem. 03/array_of_students_read.cpp b/Sem. 03/array_of_students_read.cpp index 655b38c..bd1a935 100644 --- a/Sem. 03/array_of_students_read.cpp +++ b/Sem. 03/array_of_students_read.cpp @@ -34,6 +34,13 @@ int main() Student* arr;
size_t count;
ifstream file("students.dat");
+
+ if(!file.is_open())
+ {
+ std::cout << "Error while opening the file!" << std::endl;
+ return -1;
+ }
+
readFromFile(arr, count, file);
for (int i = 0; i < count; i++)
|
