I want to write a program that opens a file with ifstream and reads each character in the file and prints it out. This is what I have so far:
PHP Code:
#include <fstream>
#include <iostream>
using namespace std;

int main()
{
    
char a;
    
ifstream fin;

    
fin.open("test.txt");
    
fin >> num;
    
cout << num// Works OK

    
while (!fin.eof()) // ?
    
{
        
// What goes in here?
    
}
    
fin.close();

    return 
0;