-
cin.get
-
cin.unget
-
getline(cin, var)
-
cin >> var
-
cout
is slow because it has to go to the operating system -
To have good speed, use internal buffers. Use
ostringstream
to build it up, build it up, and then when you're done, finally do only onecout
:cout << myStringStream.str()
-
Helps you deal with command line arguments and options.
-
Arguments versus options:
ls -a
has-a
as an argument,cd hi
hashi
as an argument -
Passing
argc
andargv
togetopt
to the function, it helps you -
getopt
has a website and the slides have stuff too -
getopt_long
you can have things like--help
; words, rather than just single-character ones
-
O(g(n)) = f(n) if g(n) is an upper bound to f(n)
-
Big omega means the worst case
-
Big theta means that the upper bound and lower bound are the same thing
-
2x^4 + 2x = O(x^4)