| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Where am I going wrong?
Ok so I am using the dev-C++ compiler not M$ so I'm not sure what headers I need to have this project compile without errors. Can anyone tell me what I need to change to make this work?
Thanks in advance. #include <iostream.h> #include <stdlib.h> #include <stdio.h> #include <graph.h> int main() { int x,y,color,index; _setvideomode(_vres16color); for (index = 0; index<10000; index++) { x = rand()%640; y = rand()%480; color = rand()%16; _setcolor(color); _setpixel(x,y); } while(!kbhit()){} _setvideomode(_defaultmode); } |
|
#2
|
|||
|
|||
|
Ok I think the problem is in the header <graph.h> but I try graphics.h and it doesn't work, I'm lost where can I find out what headers I need to plot points?
|
|
#3
|
|||
|
|||
|
Hey! I've never used that complier. I've allways worked with Turbo C++. Anyway, the library is called graphics.h, as you said correctly. The problem is that _setvideomode, setpixel and _setcolor functions do not exist in graphics.h
setcolor is defined allright. setpixel (doesn't exist) --> use getpixel and putpixel setvideomode --> must before determin the graphics card values, etc (search in help) Hope It works for you! Anibal. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Where am I going wrong? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|