Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have drawn a spiral using arc function but I need to draw it with a dotted line instead of a solid line.

What I have tried:

#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<math.h>
void main()
{
            int gd = DETECT,gm,x;
            initgraph(&gd,&gm,"..\\bgi");
			for (x=0;x<=210;x=x+20)
			{
				arc(300,250,180,0,10+x);
				arc(310.250,0,180,20+x);
			}
			delay(7000);
            getch();
            closegraph();
}
Posted
Updated 21-Jul-20 17:35pm
Comments
Richard MacCutchan 22-Jul-20 4:18am    
Why not move up to Windows programming and its more sophisticated GUI libraries?

1 solution

Does this help ? BGI Documentation for setlinestyle[^] ie
setlinestyle(DOTTED_LINE, 0, 1);
 
Share this answer
 
Comments
NerdyGirlHere 21-Jul-20 23:49pm    
setlinestyle don't affect arc function
Garth J Lancaster 22-Jul-20 0:40am    
ouch - you're correct .. I think you'd have to define your own arc() function that uses putpixel or such in that case

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900