Thread: Drawing graph in C??

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    5

    Lightbulb Drawing graph in C??

    Ok first of all, this q is regarding on my college Data Structure subject. Recently my lecturer gave us an assignment to implement those Data Structure stff (Eg. struct, queue, stack, tree, etc).

    It is about doing a student accessment program where admin can key in student info (id, name, subject & marks etc) and save the info into file. The student can able to search using their ID and display their result. So I would like to ask if there is a way to draw out a graph of the subject marks? Like y-axis is marks and x-axis is subject name. Is there a way to do so? Thanks in advance

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    There is no standard way to do graphics in C. You'd have to use a third-party library such as Allegro or SDL.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    102
    There are no built in graphical elements that you can plug in your code. You can easily write on your own. Ensure that top left corner is 0,0.
    Saravanan.T.S.
    Beginner.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    5
    I'm using XP OS and compiler is Visual C++.
    I understand tat Borland compiler bhaves different compare to Visual C++. Like colored text and structure stuff.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    5
    hello..... can someone provide me some tips on doing this?

  6. #6
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Originally posted by kbng
    hello..... can someone provide me some tips on doing this?
    Look into the line-draw functions that come with the compiler. Also cursor-movement functions with really long names (I don't rememver thye actoual name but something like setxyposition(x,y); Borland's equivalent is goyoxy();

    Other than that, you probably won't get much more with such a vague request.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Slow drawing code
    By tjpanda in forum Windows Programming
    Replies: 5
    Last Post: 05-09-2008, 05:09 PM
  2. error help making no sense
    By tunerfreak in forum C++ Programming
    Replies: 5
    Last Post: 04-17-2007, 07:55 PM
  3. Help w/ graph as adjacency matrix
    By ac251404 in forum C++ Programming
    Replies: 4
    Last Post: 05-09-2006, 10:25 PM
  4. determining a path through the graph
    By Mist in forum C Programming
    Replies: 2
    Last Post: 02-27-2005, 12:21 PM
  5. Minimize crossing edges in undirected graph
    By Shiro in forum C Programming
    Replies: 0
    Last Post: 12-26-2001, 04:48 AM