Thread: Plotting graph in turbo c++ 2.01,linux

  1. #1
    Registered User
    Join Date
    Mar 2010
    Location
    bbsr,odisha,india
    Posts
    27

    Question Plotting graph in turbo c++ 2.01,linux

    I use the turboc++ 2.01 compiler to compile to compile my C programs,and i have installed it in ubuntu linux using dosbox.Now, my prof. has asked me to draw the graph of a data inputted by the user WITHOUT USING ARRAYS.
    So, i have written a for loop which will get the x coorinate and y coordinate data.Now, i want to know how to plot a graph of this?Do i have to use any library in turbo c or do i have to call any external program?If i need to do either of these, then how?please help me as i am a beginner at these.

  2. #2
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    No one except Adak will help you. Since all of us left this dead compiler already.
    Why not use gcc in linux?! This is the craziest.. using turbo c in linux using dosbox!

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    I don't know of anything special to use for this. If the prof hasn't given you any hint of what he wants, then I'd try to take the given value, and first, find it's x value within the range of the graph - corresponding to the row on the screen. Then repeat for the y value, which would correspond to the column on the screen.

    It's easier to use an array because you are referring to one object element at a time, yet it holds all the other array values, as well. Still, it can be done "on the fly".

    I use Turbo C/C++ 1.01, so your options may be different than mine.

  4. #4
    Registered User
    Join Date
    Mar 2010
    Location
    bbsr,odisha,india
    Posts
    27
    Quote Originally Posted by Bayint Naung View Post
    No one except Adak will help you. Since all of us left this dead compiler already.
    Why not use gcc in linux?! This is the craziest.. using turbo c in linux using dosbox!
    well....i used i am learning c in tc++....moreover,i used gcc and got pained with it...it wont accept if you print a float with %d--i.e., it doent accept float to in conversions, it doesnt accept conversions from char to int,moreover, some commands like clrscr(); do not work.

    also, suppose i want to use tc++ in windows, then?

    Quote Originally Posted by Adak View Post
    I don't know of anything special to use for this. If the prof hasn't given you any hint of what he wants, then I'd try to take the given value, and first, find it's x value within the range of the graph - corresponding to the row on the screen. Then repeat for the y value, which would correspond to the column on the screen.

    It's easier to use an array because you are referring to one object element at a time, yet it holds all the other array values, as well. Still, it can be done "on the fly".

    I use Turbo C/C++ 1.01, so your options may be different than mine.
    well,i earlier used tc 1.01, its similar

    actually what the professor wants is that the user must be able to input the coordinates of five points, both the coordinates of each point at every loop instance.I have done it.Now, the main part is plotting the graph.Plz help me!!!!!!!!!!!!
    Last edited by suryap.kv1bbsr; 03-25-2011 at 02:44 AM.

  5. #5
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    Gcc give you warning while your turbo crap cannot. Because variadic function like printf cannot promote its arguments. clrscr is non standard C function. You have to use like curses library.
    I discouraged using tc. Because many tc programmers think their non standard wrong code works with tc means they are right.
    http://c-faq.com/varargs/promos.html
    Last edited by Bayint Naung; 03-25-2011 at 03:04 AM.

  6. #6
    Registered User
    Join Date
    Mar 2010
    Location
    bbsr,odisha,india
    Posts
    27
    Quote Originally Posted by Bayint Naung View Post
    Gcc give you warning while your turbo crap cannot. Because variadic function like printf cannot promote its arguments. clrscr is non standard C function. You have to use like curses library.
    I discouraged using tc. Because many tc programmers think their non standard wrong code works with tc means they are right.
    Question 15.2
    but when u compile some program that uses math.h header file , u need to write a long command in the terminal in order to compile it.Is there any better alternative to that in gcc?
    Moreover, even if i use gcc, how do you "call" something like gnuplot?????

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by suryap.kv1bbsr View Post
    but when u compile some program that uses math.h header file , u need to write a long command in the terminal in order to compile it.Is there any better alternative to that in gcc?
    Use an IDE.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Elysia View Post
    Use an IDE.
    Code::Blocks

    Click on the red text ... Multiple linux versions available.

  9. #9
    Registered User
    Join Date
    Mar 2010
    Location
    bbsr,odisha,india
    Posts
    27
    thanks for suggesting a good compiler but will gnuplot work with code::blocks?If yes, then how do we call it ina c program?I could not understand the gnuplot tutorial as it is a bit screwed up

  10. #10
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by suryap.kv1bbsr View Post
    thanks for suggesting a good compiler but will gnuplot work with code::blocks?If yes, then how do we call it ina c program?I could not understand the gnuplot tutorial as it is a bit screwed up
    Code::Blocks is not a compiler. It's an IDE.

    Use it with GCC and it will compile anything GCC (more or less the standard compiler for *nix systems.) will compile.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. plotting a graph
    By cracker in forum C Programming
    Replies: 4
    Last Post: 09-23-2009, 05:37 AM
  2. error help making no sense
    By tunerfreak in forum C++ Programming
    Replies: 5
    Last Post: 04-17-2007, 07:55 PM
  3. Plotting a graph with Koolplot
    By Router in forum C Programming
    Replies: 13
    Last Post: 11-05-2006, 09:07 PM
  4. Remember Turbo? It is comming back
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2006, 01:26 PM
  5. graph plotting
    By wayne in forum C++ Programming
    Replies: 3
    Last Post: 05-25-2005, 02:47 AM