hi I've read several articles about the streams and i know a bit about them . for example they are not random access they are serial interface or for example they are a flow of data ..as far as I'am concerned so but what are they really ..this what is making me really confused and i don't get the point of it you know my main problem with the concept is that i don't understand the abstraction let me give you an example :
strign S;
std::cin>>string S;
so as far as i konw when we write this this means that the "cin" is a iostream object that the ">>" is a overloaded operation for iostream objects and cin is synced to keyboard .so it reads the data from keyboard and then the string "S" is some how a distention for cin stream and then the data which is captured from the keyboard are put to the string "S" or let's consider this code :
string largest_number(vector<string> a) {
std::stringstream ret;
for (size_t i = 0; i < a.size(); i++) {
ret << a[i];
}
string result;
ret >> result;
return result;
}
in this code what i understand is that the ""ret"" is a stringstream as it is obvious by declaration and does it only read the string type input??(i guess so) and then by the operator ""<<"" we put the data to the stream and then by "">>"" we some how put the data in ""result"" and because the ""ret"" is a stream the result could be any type which is chosen string here i know this much but still i feel that I'm far away from understanding the core concept of streams if any one could help me with this concept and give's me a very gentle idea to get the gist of the streams