Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Seek and Skip in C++

#include <fstream>
#include <iostream>

using namespace std;

int main(){
    ifstream in("datafile");
    in.unsetf(ios::skipws);                     
    char ch;
    while (in >> ch) {                          
    cout << ch;                                 
    }
    cout << '\n';
    in.clear();
    in.seekg(ios::beg);                         
    in.setf(ios::skipws);                       
    while (in >> ch) {                          
         cout << ch;                            
    }
    cout << '\n';
    return 0;
}