Assuming you mean ::
instead of :
and that you are using using namespace std;
(which is generally considered bad style because it can lead to problems, see Why is "using namespace std;" considered bad practice?), then there is no difference between the two snippets.
As you can see in a reference for the function std::basic_ios::tie
, the overload you are using returns a pointer to the previously tied stream as std::basic_ostream*
.
In the reference for the function std::ios_base::sync_with_stdio
you can see that it is a static member function of std::ios_base
. So we can call it on any instance of std::ios_base
. std::basic_ostream
inherits from std::ios_base
as also shown in the reference, so we can also call it on the std::basic_ostream*
pointer returned from cin.tie(0)
.
->
is just the indirect member access as usual, used here to perform the member function call on the pointer returned by cin.tie(0)
.