I have started learning C++ and I think the language is great, but few things are baffling me while I am on my path learning it. In this example:
cout << setiosflags(ios::fixed) << setiosflags(ios::showpoint);
In this example why do we type the whole setiosflags(ios::...)
when the program still does the same if I only type showpoint
without setiosflags
?
Second question I have is simple. If we have the following:
int x=0;
cin>>x;
Why do we define a value for int
if we later change it to something different than 0
?