Category : dynamic-arrays

As an example input file: 02-03-2004,13045634 03-02-2004,16782930 I’m having trouble coming up with code that can read in inputs into different arrays properly. My most recent attempt is this: int i = 0; if(inputFile.is_open()){ while(!inputFile.eof() && i < arraySize){ getline(inputFile, line, ‘,’); date[i] = line; //array of type string getline(inputFile, line, ‘,’); deaths[i] = line; ..

Read more

The program returns the user N number of odd squares starting from 1. From numbers 5-10 and then 20, (I didn’t go further) when deleting array A it crashes with the error message: "Process returned -1073740940 (0xC0000374)". Which is apparently a memory violation? #include <iostream> using namespace std; int main(){ int ok; int counter; do ..

Read more