I have a structure tcp_option_t
, which is N
bytes. If I have a pointer tcp_option_t* opt
, and I want it to be incremented by 1, I can't use opt++
or ++opt
as this will increment by sizeof(tcp_option_t)
, which is N
.
I want to move this pointer by 1 byte only. My current solution is
opt = (tcp_option_t *)((char*)opt+1);
but it is a bit troublesome. Are there any better ways?