File input and output

Hi,

I just started taking my masters degree in computer science. As you y'all know it's some serious sh*t. Anyways, I have an assignment I need to finish this Friday, I feel so stupid for not being able to keep up with the level of programming. I stopped programming in four years, and now I find really difficult to deal with. I hope you guys have some good tips and advice for me. So, my question is how to read a NxN matrix out of a file then use the values to solve 3 different problems such as "The traveling salesman" and "The spanning tree algorithm" and such.

thank you very much.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
    ifstream inputf;
    inputf.open("Inputs.txt");
    string buffer;
    int integers[100];
for (int i=0;i<=5;i++) {
        for (int y = 0;y<=5;y++){
    inputf>>integers[i];
   cout << integers[i] << ',' << ends;
        }
}
inputf.close();
}
Topic archived. No new replies allowed.