Using which library? Or if that's part of the question: for which operating system?
Step back a bit.
C is a general purpose programming language. It specifies almost nothing about your hardware. C is used to program dishwashers and hard drive controllers and DVD players and telephones. C does not know what a keyboard is, or a monitor, or colours, or sounds. None of that is required by the C language.
This means that everything involving graphics relies on someone having written extra software to work with your hardware. If you have a sound device on your hardware, for example, someone must write the software for it and that software will not be part of your C compiler. Sometimes, your operating system will provide that software for you, in which case you won't have to install it but you will still have to learn how to use it. Sometimes, you will have to go looking for that software yourself, install it and then learn how to use it.
So, firstly, examine your operating system and see if it provides any functions and libraries for you to generate sound. If not, you will have to find some on the web, download it, install it, and learn how to use it. Because displaying graphics is sometihg your OS can already do (unless you're reading this over a teletype) it does already have libraries you can use. They may be easy. They may be horrifically difficult.
C is a very, very general purpose programming language and all that sort of thing is provided by additional software written specifically for your hardware. Long story short - there is no way within the C language definition and you have to work a bit harder for it.
A long time ago, in the days of DOS, some C compilers used to come with simple libraries to draw lines. If you're using one of those ancient C compilers, don't be tempted to use the graphics library it came with. Throw it all away and get something made in the last twenty years.
Edited 3 Years Ago by Moschops
ok..i am using windows 7 os and am currently trying to draw the y=mx+c graph using 'graphics.h'...
can you please direct me with regards to the libraries that might be needed to generate the graphics....
graphics.h was a header file that came with Borland /Turbo C about twenty years ago. It's meant to be used in DOS. Twenty years ago.
Do you want to make an image file, or do you want to put a box on the screen and change the values of the pixels in that box?
You could do this with a low level library SDL and SDL_draw or SDL_gfx.
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...