The intresting piece is in bold
for ( std::size_t i = 0; i < size && result; ++i, result = stream.good() ) stream << [B]*data++[/B] << std::endl; stream.flush();
Here's a piece of code from my exercise
int b; int* p1; b = 2; p1 = &b; *p1++; std::cout << *p1 << std::endl;I did some research (Operator precedence @ wiki) and as you can see ++ is far above * dereference operator. When I run my code without parenthesis I get some junk result, since I guess, address gets incremented first. But if I use parenthesis (ie (*p1)++; ) it works. The thing I don't understand how his code works without parenthesis and mine doesn't.


Sign In
Create Account


Back to top









