Adding one to a value in C++ for a PIC Micro
Binary is just how the literal 0b000000 is expressed in the program, internally they are all binary numbers so 0x00 for hexadecimal or just a straight 0 for decimal would all do the same thing. Your code should be as simple as this for cycling the first three bits for the port:

for(i=0; i &lt; 8; i++)
    GPIO = i;


Note though that that will overwrite the contents of the whole port so if you're using other parts of the port for output you may want to keep track of it's state. Either that or you may be able to use code such as the following to just set the lower three bits depending on whether the compiler and PIC being used allows that GPIO value to be read back:

for(i=0; i &lt; 8; i++)
    GPIO = (GPIO &amp; 0b11111000) | i;


That just uses an AND operator to read back the port value with the lower three bits cleared and then uses an OR operator to include the contents of i.