let's assume you want to fill an image which is simply an array of width*height integers.
instead of adressing each pixel individually, like this:
for (y=0; y < height; y++)
{
for (x=0; x < width; x++)
{
adress= y * width + x;
image[adress] = color;
}
}
...you just increase your pointer when stepping from one pixel to the next:
dest= image;
for (y=0; y < height; y++)
{
for (x=0; x < width; x++)
{
*dest= color;
dest++;
}
}
any half-decent compiler will do this optimization automatically for you, though.