Introducing Radical.sh

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

File size in C++

#include <iostream.h>
#include <fstream.h>

const char * filename = "test.txt";

int main () {
  long l,m;
  ifstream file (filename, ios::in|ios::binary);
  
  l = file.tellg();
  
  file.seekg (0, ios::end);
  m = file.tellg();
  
  file.close();
  
  cout << "size of " << filename;
  
  cout << " is " << (m-l) << " bytes.\n";
  
  return 0;
}