#include <stdio.h>
#include <iostream.h>
#include <unistd.h>



int main() {
    FILE *fp;
    char name[1025][10];
    int i, j, elem;
    char junk[10] = "Unknown \0";
 
    for (i = 1; i < 1025; i++)
        for(j = 0; j < 10; j++)
             name[i][j] = junk[j];

cout << " inited name[i][j] " << endl;

    fp = fopen("tcp.services", "r");
    if (fp == NULL) 
        {
        cout << "tcp.services non existant" << endl;
        exit(-1);
        }

cout << " opened file starting loop" << endl;

    while(fscanf(fp, "%s",junk) != NULL)
        {

cout << " scanned in first string " << endl;

        fscanf(fp, "%d", elem);

cout << " scanned in element " << endl;

        for ( j = 0; i < 10; i++)
            name[elem][j] = junk[j];
        }

cout << " scanned in info " << endl;

    for (i = 1; i < 1025; i++)
        cout << i << ": " << name[i] << endl;

cout << " printed output " << endl;
    
    return 0;
    } 
