Hey guys, trying to get my sudoku puzzle to print the standard input that it receives from a .txt file, yet I'm unable to type anything in the console at all. It just says "Press any key to continue.." and doesn't give me the option to type any input. The bolded sections are where I'm having problems.

Code:

#include <iostream>
#include <fstream>
#include "intset.h"
using namespace std;
typedef SetOfSmallInts Puzzle[9][9];
typedef SetOfSmallInts* PuzzleSection[9];
/****************************************************************
* copyPuzzle *
****************************************************************
* Copy puzzle p into q. For example, if p is a puzzle, then *
* Puzzle q; *
* copyPuzzle(q, p); *
* stores a copy of puzzle p into q. *
****************************************************************/
void copyPuzzle(Puzzle q, Puzzle p)
{
int i, j;
for(i = 0; i < 9; i++)
{
for(j = 0; j < 9; j++)
{
q[i][j] = p[i][j];
}
}
}
/****************************************************************
* getRow *
****************************************************************
* Store the i-th row of puzzle p into puzzle section R. *
* The rows are numbered from 0 to 8. *
* *
* After doing this, the k-th set in row i is *(R[k]). *
* Do not omit *(...). The cells in the row are numbered *
* 0,1,...,8. *
****************************************************************/
void getRow(PuzzleSection R, Puzzle p, int i)
{
int j;
for(j = 0; j < 9; j++)
{
R[j] = &(p[i][j]);
}
}
/****************************************************************
* getColumn *
****************************************************************
* Store the j-th column of puzzle p into puzzle section R. *
* The columns are numbered from 0 to 8. *
* *
* After doing this, the k-th set in column j is *
* *(R[i]). Do not omit *(...). The cells in the *
* column are numbered 0,1,...,8. *
****************************************************************/
void getColumn(PuzzleSection R, Puzzle p, int j)
{
int i;
for(i = 0; i < 9; i++)
{
R[i] = &(p[i][j]);
}
}
/****************************************************************
* getSquare *
****************************************************************
* Store the k-th square of puzzle p into puzzle section R. *
* The squares are numbered as follows. *
* 0 1 2 *
* 3 4 5 *
* 6 7 8 *
* For example, square 4 is the middle square in the puzzle. *
* *
* After doing getSquare, the i-th set in the square is *(R[i]).*
* Do not omit *(...). The cells in the square are numbered *
* 0,1,...,8, in the same pattern shown above for the squares *
* themselves. For example *(R[3]) is the first position in *
* the second row of the square. *
****************************************************************/
void getSquare(PuzzleSection R, Puzzle p, int k)
{
int i;
for(i = 0; i < 9; i++)
{
R[i] = &(p[k - k%3 + i/3][3*(k%3) + i%3]);
}
}
[B]/****************************************************************
* readPuzzle *
****************************************************************
* The readPuzzle function reads a puzzle from the standard *
* input then stores it into p. *
****************************************************************/
void readPuzzle(Puzzle p)
{
int i,j;
for(i=0;i<9;i++)
{
for(j=0;j<9;j++)
{
char c;
cin >> c;
if (c >= '1' && c <= '9') p[i][j] = singletonSet(c - '0');
else if(c == '-') p[i][j] = rangeSet(1,9);
}
}
}[/B]
//char buffer = '0';
//ifstream puzzleFile;
//puzzleFile.open("puzzle1.txt");
//int countCol = 0;
//int countRow = 0;
//
//while(puzzleFile >> buffer)
// {
// if(buffer >= '1' && buffer <= '9') p[countRow][countCol] = singletonSet((buffer - '0')); //If input is between '1' and '9', it will take the input and minus '0' to get the singleton set.
//
// if(buffer == '-') p[countRow][countCol] = singletonSet(0); //If it finds a '-', it will input a zero into its place instead.
// countCol++;
// if(countCol == 9)
// {
// countCol = 0;
// countRow++;
// }
// }
//}
[B]/****************************************************************
* printPuzzle *
****************************************************************
* The printPuzzle function prints Puzzle p in standard output. *
* If the set is not a singleton set, then it will write a '-' *
* If it is empty, it will write a zero. If it is a *
* singleton set, then it will write a specific number into that*
* set. *
****************************************************************/
void printPuzzle(Puzzle p)
{
int single;
for(int i=0;i<9;i++)
{
for(int j=0;j<9;j++)
{
single = onlyMember(p[i][j]); //If s is a singleton set, then onlyMember(s) returns the member of s. If s is not a singleton set, then onlyMember(s) returns 0.
if (j == 3 || j == 6) cout << " "; //Once it hits column 3 and 6, it will print a space.
if (single == 0) cout << "-"; //If the singleton set is a 0, then it will print a "-".
else cout << single;
}
if (i ==2 || i == 5) cout << "\n"; //Once it hits row 2 and 5, it will print a newline.
cout <<"\n";
}
}[/B]
/****************************************************************
* showPuzzle *
****************************************************************
* The showPuzzle function will print Puzzle p on the standard *
* output. If there is a particular set with a singleston or *
* multiple numbers, then it will print out all of those aswell.*
* If a set is an emptyset then it will return a 0 for that set.*
****************************************************************/
void showPuzzle(Puzzle p)
{
}
int main()
{
Puzzle p;
readPuzzle(p);
printPuzzle(p);
system("PAUSE");
}

Here's the include files and the input txt.

Files I have to use to make it work,

http://www.cs.ecu.edu/~karl/3300/spr09/sudoku/intset.h

http://www.cs.ecu.edu/~karl/3300/spr09/sudoku/intset.cpp

http://www.cs.ecu.edu/~karl/3300/spr09/sudoku/puzzle1.txt