as for your first problem, that is the best way, there are other ways dda line, bresenham line but then you would have to code the whole code for it to draw a this old way is better i would say

ps - don't know why no one notices but we never give any value to gmode variable...
you can replace &gmode with NULL in initgraph(), it works for me in TC, try it in your compiler.
Also instead of DETECT, you can give value 0 too, as its the same thing..