samedi 31 janvier 2015

Reading a file into a an Array


Vote count:

0




Let's say I am coding a C++ program to read a text file "file.txt" containing data of double type. I'd like to perform some arithmetic operations on the data and hence my best venue is to store it into an array D such that dim(D) = 1.


The problem is that to declare D I must use a known constant to tell it how many lines it should have. What if I don't know how large the data in "file.txt" is? How do I declare the array then?


Thank you



asked 7 mins ago







Reading a file into a an Array

Aucun commentaire:

Enregistrer un commentaire