Please Help Me!!!! Could anyone here please explain to me in an easy to understand (newbie) way on how to even draw something please!!! I'm Desperate and your my last chance!
Please Help Me!!!! Could anyone here please explain to me in an easy to understand (newbie) way on how to even draw something please!!! I'm Desperate and your my last chance!
moveTo and Lineto will drawl something, heres an example: This will drawl Hello World inside of two lines.
Code:/* Steven Billington September 9, 2002 hwgraphics.cpp This program will display hello world with lines around it. Simple graphics demonstration. */ #include <graphics.h> int main () { lineTo (100,100); moveTo (50,50); lineTo (50,0); moveTo (50,50); lineTo (150,50); outText (55,100, "HelloWorld!"); moveTo (50,130); lineTo (150,130); return 0; }
First off not to be rude thats a horrible example because graphics.h is not standard, its old as hell which means you must be using borland turbo C/C++ 3.1 or earlier.
"only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein
Visual C++ .NET actually, the graphics.h file i use is from the student files that go with my CS2 book.its old as hell which means you must be using borland turbo C/C++ 3.1 or earlier.
Sorry if it sucks but he said ANYTHING. It doesn't seem hes put much effort into finding it himself so i didn't put an incredible amount of effort into my example.
I tried graphics.h and it said no such directory (by the way im using DJGPP) please helpWhy are Greenboards White?
Umm, you can't just download a header and expect it to work. Check the FAQ to see why
IDE: Dev C++ 5
Lib: Allegro
OS: Windows 2000
in this instance u can because the code i wrote is specified to the book that the header is made for.
With that attitude you wont learn anything Stan. heres something for you to play with
Code:#include <iostream> int main() { cout << "Hello"; return 0; }
That's not right either, Kirdra.
Code:#include<iostream> using namespace std; int main() { cout << "Hello World"; return 0; }
I never use; using namespace std... I read I didn't "need" to.
I know somewhat how to program. I can print words on the screen etc. I don't know how to make graphics. Whenever I try to use <graphics.h> or "graphics.h" it says unknown file and i have the allegro files. HELP!
thats actually quite rite.That's not right either, Kirdra.
There is no need to use namespace here, and her example is fine for what it is.
Stan thats because u need to have graphics.h installed, use the download i supplied for you to get it.
I have the file, it's in my allegro folder, but it (DJGPP) doesn't reconnize it HELP!!
hmm other than here i don't know man