Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-19-2007, 05:31 PM   #1
Registered: Jul 2005
Posts: 273

Rep: Reputation: 31
making circles with c++


I'm learning to program in c++. My problem being that I am using a MS visual studio book.

Right now it's calling for a header called msoftcon.h. Any solutions to work around this head file? The example code is looking for me to make text based circles.... and obviously is a problem when it comes to this.

I heard something about using curses, but I'm not seeing any circle statements or anything.

Am I way off here? Any help would be appreciated.


Last edited by neocontrol; 05-06-2010 at 02:33 PM.
Old 01-19-2007, 06:36 PM   #2
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
What are you trying to do? SDL is generally better for simple 2D graphics.
Old 01-19-2007, 09:16 PM   #3
Registered: Jul 2005
Posts: 273

Original Poster
Rep: Reputation: 31
Right now it looks like I'm making circles from ascii. One is with letters, and the other is filled in with blocks and colored, and the other one is with symbols.

What exactly is SDL? I don't care if I follow the book exactly, as long as I'm learning concepts.
Old 09-16-2008, 01:05 PM   #4
Registered: Sep 2008
Location: USA
Distribution: Linux Mint Qiana
Posts: 190

Rep: Reputation: Disabled

I know I should not pump old threads but I am stuck at exactly the same problem as described here. I apologize in advance if I break some rules.

Here is the code:
//Circles as graphics objects
//Code from R. Lafore "OOP with C++
#include "msoftcon.h"           //for graphics function

struct circle
   int xCo, yCo;                //coordinates of center
   int radius;
   color fillcolor;             //color
   fstyle fillstyle;            //fill pattern

void circle_draw(circle c)
   set_color(c.fillcolor);              //set color
   set_fill_style(c.fillstyle);         //set fill pattern
   draw_circle(c.xCo, c.yCo, c.radius); //draw solid circle

int main()
   init_graphics();                     //initialize graphics system

   circle c1 = {15, 7, 5, cBLUE, X_FILL};
   circle c2 = {41, 12, 7, cRED, O_FILL};
   circle c3 = {65, 18, 4, cGREEN, MEDIUM_FILL};

   circ_draw(c1);                       //draw circles
   set_cursor_pos(1, 25);               //cursor to lower left corner
   return 0;
My question is:
How would you modify this code to work on a Linux box?

Old 09-16-2008, 09:35 PM   #5
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
you could look at using libcaca (color ascii art library). I haven't done any development with it myself, but I have used mplayer with it driving a color ascii terminal and it actually looked decent.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making sure I did it right Ludwig7666 Linux - Newbie 7 08-02-2006 03:28 AM
MDK 10.2 install running me in circles micromidget Mandriva 15 03-23-2005 09:44 PM
Simple circles elvee Programming 8 09-21-2004 02:22 PM
mounting usb thumbdrive and going in circles slackist Linux - Hardware 11 07-27-2004 09:30 PM
Making an OS... eam Programming 4 01-27-2004 03:46 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration