I see that you have the scanf line commented out. You can look at a reference for scanf such as this page
. There's more than one way you could do this. You could use the %u, %x or %s format specifiers. If you use %s, you will have to use something like atoi to convert it to a number. After you retrieve the user's value, you have to do range checking. You could just do a do/while loop for this - just terminate the loop when the values are valid. Something like this would work:
printf("Enter the red component's value:");
} while (red <= 255);
You can just Google line-drawing algorithms. One of the first pages that pops up is http://www.cs.unc.edu/~mcmillan/comp...re6/Lines.html
. If you are going to delve much deeper into graphics code, you probably want to check out some books specifically on graphics programming.