Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Can someone provide me with the code to some C program that actually works. Or even the code to some C game such as the popular snake game, or tetris, etc. But please nothing that has to do with C++ or C#

OpenStudy (anonymous):

@ganeshie8 , @hba , @eSpeX

OpenStudy (espex):

There are plenty of examples of C code here: http://www.programmingsimplified.com/c-program-examples

OpenStudy (anonymous):

Right, but they introduce the header file graphics.h, how do I implement this into my code?

OpenStudy (espex):

Who introduced the header file and what code are you implementing?

OpenStudy (anonymous):

Take a look at this link: http://www.programmingsimplified.com/c/program/draw-shapes They include conio.h and graphics.h. conio.h comes standard in visual studios, but when I include the graphics.h header file in the code, it gives my a compiler error.

OpenStudy (espex):

If you read through their page on the graphics.h file you will see that it is a library included in the Turbo C compiler. The basic code examples work for all C as far as I know. You could look at the functions defined in their graphics.h and create your own header file.

OpenStudy (anonymous):

Okay, so there is no such header file in visual studios?

OpenStudy (espex):

None that is included in the standard libraries that I know of, though it might be under another name, you might try the gdigraphics.h file.

OpenStudy (anonymous):

What i'm trying to say is, How would I run that exact same code that is found on: http://www.programmingsimplified.com/c/program/draw-shapes and get the same results. For some reason It won't let me copy that code into visual studio and execute it without errors.

OpenStudy (espex):

Right, some of the functions called are included in that graphics.h file, if your compiler doesn't understand the request it will not compile.

OpenStudy (anonymous):

Okay, I'll give that a try. I just noticed that you have to download an additional package for windows 7 graphics.

OpenStudy (espex):

If you are a new programmer and interested in graphics, might I suggest you consider Java.

OpenStudy (anonymous):

Thanks, I'll look into it.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!