Quote Originally Posted by userxbw View Post
I hope this helps more than hinders,
Code:
#include <stdio.h>

int main ()


{
    int row;
    int col;
    int space = 16;


    for (row = 1; row <= 5; row++) //rows
    {
        for (col = 1; col <= row ; col++) //columns
        {
                //printf("*");
                //printf("%d",space);
                printf("%*c",space,'*');
        }
space--;
            printf("\n");
    }
    return 0;
}
but it does demonstrate how to get the star moved over before printing, it is not an complete answer.
Can you explain with this printf statement is doing? printf("%*c",space,'*');

I understand that the %c is identifying the data type that will be printed but I'm not sure I understand what the asterisk is doing between the % and the c. Also, the ,space, portion of the statement... Space is an integer data type variable which in this code initially has a value of 16 (and is later decremented and thus the space reduces by one in the next loop). My question is, what part of that statement is handling the actual leading space itself?