can sum1 translate that to ordinary english so that we may hav a laugh too...... !?!
LOLCODE to Read a file :
Code:
HAI
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
AWSUM THX
VISIBLE FILE
O NOES
INVISIBLE "ERROR!"
KTHXBYE
Notes:
PLZ … ? introduces a try/exception block
AWSUM THX introduces the block to execute on success with PLZ. It is implicitly closed by…
O NOES, which is the exception block. It should be closed with KTHX, but it hits the final KTHXBYE, which (I assert) is a bit of syntactic sugar that closes everything.
OPEN handles non-default-terminal-based I/O. FILE in this case is simply a variable, a file handle for the LOLCATS.TXT file.
INVISIBLE is a print command to the debug console, commonly known as STDERR.
C++ Equivalent:
Code:
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream fin;
fin.open("LOLCATS.TXT");
if(fin)
//Code to go through file n print it
else
cout << "Error !";
}
__________________
There are 10 types of people in the world: those who understand binary and those who do not.