i'm in C++ right now and we're learning some coding. i have basic programming knowledge but when i look at the program, i see >> and << used interchangably. what do they mean? and when/why do i use them?
Dunno if what I'm going to say can be useful to you but... I'm studying C++ since very few days, maybe two week, and I've understood that >> and << are the symbols for shifting the bits. For example b>>2 is used to shift the element b to right for 2 positions and << is used to shift to left. Then Code (Text): <div class="text" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">cout<<'......'<<</li></ol></div> is used to write a message in the screen, and Code (Text): <div class="text" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">cout<<variable<<</li></ol></div> to write the value of the variable. Instead you have to use >> when the system has to read a variable, using Code (Text): <div class="text" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">cin >>variable</li></ol></div> For now these are the only things I know about >> and << ^^"