How do I fix the below error?

  • Thread starter Thread starter Brown12345
  • Start date Start date
B

Brown12345

Guest
std::ifstream InFile(inFile);
while (!InFile.eof()) {
std::getline(InFile, line);
std::stringstream sst(line);
sst >> num;
array[loop] = num;
std::cout << array[loop] << std::endl;
loop++;
}

else {

std::cout << "Error Loading file";
}

InFile.close();



I have looked at various tutorials and examples here too but nothing seems to work. Can someone please be helpful and show me how I could use the above signature to read from a file and store in an array. Can you show it by using the below signature?

int StoreDate(wchar_t* inFile, int num[], int maxSizeofArr)

wchar_t* inFile //inFile is the file name

int num[] // the array

int maxSizeofArr // maximum size of the array

Continue reading...
 
Back
Top