So I have been taking a break from posting and writing in C++, and switched to python. Unless you are using C or C++ for a reason, then you should switch too, and here is why...
Python: 60 seconds
C++: 4 minutes
Witch one did you think took longer to write?
LOL,
-Tristan
Python: 60 seconds
#document reader for python 2.7 in windows
import os
fname = raw_input("Please enter a file name: ")
os.system("cls")
file1 = open(fname, "r+b")
fileinput = file1.read()
print fileinput
C++: 4 minutes
#include <iostream>
#include <cstdlib>
#include <string>
#include <fstream>
using namespace std;
int main()
{
cout << "Enter a file name to read: ";
string fname
cin >> fname;
system("cls");
ifstream readfile;
readfile.open(fname);
string data;
readfile >> data;
cout << data;
}
Witch one did you think took longer to write?
LOL,
-Tristan
0 Comments On This Entry
Trackbacks for this entry [ Trackback URL ]
Tags
My Blog Links
Recent Entries
-
-
-
back from break, well sort of...on Jul 10 2012 07:59 AM
-
-
Search My Blog
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
Categories
|
|



Leave Comment










|