I have a file which contains array like this :
5
23
232
44
53
43
so line contains number of elements. Which means number of elements need to read. And create a array.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
fstream mystream("file.txt");
int ArraySize;
int* array;
ArraySize = ......... //read first line
for(int i = 2; i < ArraySize; i++){
...............//add elements to the array
}