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 ]
← April 2018 →
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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)