You have your operator the wrong way round: Each time you are setting it to +1: pos_offset = +1;
Try changing it to this instead: pos_offset += 1;
Also, the danger with your function there is you perform no bounds checking on pos_offset, so it is easy for a segmentation fault to occur, and if you have multiple instances of Screen_outputpos_offset will have the same value between them, which could be problematic (based on what you are trying to do, of course).