I'm new here, I searched for any related post like my question and I found nothing
I have a project to create a math function graph in a console like f(x)=ax^2+bx+c the user give me a b c and I draw the function.
Someone told me that there are a library called graphic.h that help me with that
so if someone can help me, I'm not finding anything about graphic.h and my project
And if there are another library or anything that could help
Sorry for incomplete answer but you have incomplete question so it is impossible to answer ...
What environment you have to use ? You wrote console but what compiler and OS ? because graphics is very different for each
many schools still use DOS console apps which is not the same as win or linux console. In DOS there is graphics.h which switch to gfx video mode and then you can use CGA/EGA/VGA and sometimes VESA graphics. Haven't done anything in it since Turbo Pascal 7.0 few decades ago.
graphics.h stands for BGI (Borland Graphics Interface) but you need CGA/EGA/VGA or VESA for proper functionality. Most gfx cards emulate them so that should be no problem just do not expect any arbitrary pixel or color resolution. It can handle 640x480x16 or 320x200x256 and the rest depends on your HW. This lib is native only to ancient Borland/Embarcadero compilers so you will find it somewhere in include path so use
< > not
" " !!! (you do not need to copy it to your project).
You have to create graphics window by WinApi or by IDE of your programing language and then you can use GDI which is part of WinAPI and most compilers have libs for it natively.
linux or different GUI OS
I do not code for such so I do not know exactly but should be similar to Windows
OpenGL (any GUI OS and also sometimes DOS with proper drivers)
if you use OpenGL then you can find tons of examples how to create gfx window + OpenGL and also OpenGL GLUT (OpenGL utilities) have functions that take care of windows stuff. You just code code for events like keystroke, mouse move, redraw ...
google NeHe OpenGL tutorials ... not my favorite but beginners like it
Look here for some more info
Now for the function plot
y value for each
do not forget to scale and offset
x,y values to fit your gfx area !!!
draw line from previous to actual point
with different color than clear ...