What is the significance of including
ios_base::sync_with_stdio(false);cin.tie(NULL);
in C++ programs?
In my tests, it speeds up the execution time, but is there a test case I should be worried about by including this?
Do the 2 statements always have to be together, or is the first one sufficient, i.e., ignoring cin.tie(NULL)
?
Also, is it permissible to use simultaneous C and C++ commands if its value has been set to false
?
https://www.codechef.com/viewsolution/7316085
The above code worked fine, until I used scanf/printf
in a C++ program with the value as true
. In this case, it gave a segmentation fault. What could be the possible explanation for this?