3) If anything is deprecated, try not to use it. Using strstream and stringstream in the same program will probably be like mixing iostream with stdio (but stdio is not deprecated FYI). Unless you are adapting older C code in a C++ program, you should probably lean more toward iostream (if you are writing a C++ program, of course).
Edit: I suppose a more correct answer is this classic example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <stdlib.h> //<-- Note the ".h" at the end. This is a C file, not a C++ file
#include <stdio.h>//<-- Also a C and not C++ file
#include <iostream.h>//<--Nonstandard form of iostream; different compilers will have different implementations
//Just showing you so you know
usingnamespace std;
int main(){
char hi;
while(true){
cout << "Hi, press something: ";
getch(); //Deprecated method; restricted mainly to Windows OS
_getch(); //Have no clue how different this is, but I've seen it; it is nonstandard
getchar();//C method for grabbing a character
cin >> hi;//This has a rare chance of acting differently under the iostream.h header.
}
return 0x00BAD; //Not returning 0 because this program is all bad
}
getch() and _getch() above may or may not compile on different compilers.
iostream.h will definitely be compiled differently, so any implementations you have with its methods might not act the way you think.
Moral: Stick with standards, so your program is more flexible.