what dose flushing the buffer ezactly mean please explain like very simply im really confused also what are the uses of flushing a buffer(whatever it means pls tell me what it means) and do professional programs use std::endl or /n
also i got a error for a very simple programme here is the code (tell me what i did wrong)
1 2 3 4 5 6 7 8 9 10 11 12 13
int main ()
std::cout << "Test" <<std::endl;
std::cout << "new" <<std::endl;
What did i do wrong i use two ostream objects ending it with endl but when i change it to /n it somehow works
it does execute but shows a blank with a error code saying returning bunch of numbers
i appreciate anyone who is even bothering to click on this post it still means a lot :) have a good day programmers
It will be output when your library decides it is time. Usually it happens before reading from stream, when buffer is full and from time to time. Many manual flushes will slow down program, because it will not be able to make use of advantages of buffered input.
I have answered your PM.
If I got your question right, you might find helpful these online language references: http://www.cplusplus.com/reference/ http://en.cppreference.com/
They contain information about language features and standard library. Also you might want (after you finish with beginner level stuff) to get a copy of C++ standard. It is basically is a description how language should work. It is very hard to read nad it is better to not try to read if you don't yet get hold of C++.
That depend. If you would want to learn C after you good In C++, go for it. It will help you to understand low-level stuff. If you will decide to move to higher level languages, that is fine too. It is too early to think about that.