I've tried include and include"studio.h". Compiler says eof not declared in this scope.
I have if(infile.peek()==eof())
I
I've tried include and include"studio.h". Compiler says eof not declared in this scope.
I have if(infile.peek()==eof())
I
You'don't better refer to the following thread: How does ifstream's eof() work?
In C you should include stdio.h and use EOF constant.
#include "stdio.h"
....
if (getc()==EOF){...}
Or use this reference for C++: cstdio
#include <cstdio>
#include <iostream>
...
if(infile.peek()==infile.eof())