hello there, can anyone here explain to me and an explanation on the usage of these operators (<< and >>) or point me to any site that explains it very well... thank you... :)
jaepi
22
Practically a Master Poster
Recommended Answers
Jump to PostTheir use and meaning depends entirely on context. For built-in integral types, they are bitwise operators for bit-shifting operations. Under these circumstances, << means "shift left" and >> means "shift right".
More commonly, you see them in C++ for input and output. Under these circumstances, << means "Outputs to" …
Jump to Post>>what do you think will happen to the values of x, y and z?
why don't you just compile and run the program then you can find out for yourself instead of guessing.
Jump to PostOf course it didn't show anything because you have to add a line or two to print the value of the variables to the screen, something like this:
cout << "x = " << x << "\n";
All 11 Replies
Bench
212
Posting Pro
jaepi
22
Practically a Master Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jaepi
22
Practically a Master Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jaepi
22
Practically a Master Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jaepi
22
Practically a Master Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
gopi kannan
-2
Newbie Poster
jaepi
22
Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.