for loop wont print in visual studio

I'm deciphering someone's code because the coder didn't comment anything

So I try to print the for loop in visual studios and it just runs the code but doesn't display anything

I've tried doing cout << NOBS; but nothing displays

int main()
{
    const int gal = 58;
    int header = 0;
    string line;
    string item;
    string skip("#");
    ifstream NOBS;
    NOBS.open("C:/Users/Luis/Desktop/DM/MADHAT-master/PMFdata/Fermi_Pass8R3_239557417_585481831/NOBS.dat");
    header = 0;
    NOBS.seekg(0, ios::beg);
    while (getline(NOBS, line)) {
        if (contains(line, skip)) {
            header++;
            
        }
        else {
            break;
        }
        NOBS.seekg(0, ios::beg);
        for (int i = 0; i < header; ++i) {
            getline(NOBS, line);
        }
        float obs_data[gal][3];
        for (int i = 0; i != gal; ++i) // This for loop loops through the lenght of gal and adds 1 to every loop to get to the end of gal i.e 58 -LR
        {
            for (int j = 0; j != 3; ++j)
            {
                NOBS >> obs_data[i][j];
               
            }
            
        }
        return 0;
    }
}


Read more here: https://stackoverflow.com/questions/66270231/for-loop-wont-print-in-visual-studio

Content Attribution

This content was originally published by Enrique92 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: