C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 29th, 2005, 03:36 PM
Zerokule Zerokule is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 Zerokule User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 31 sec
Reputation Power: 0
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);

}

Reply With Quote
  #2  
Old January 29th, 2005, 11:28 PM
Zerokule Zerokule is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 Zerokule User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 31 sec
Reputation Power: 0
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?

Reply With Quote
  #3  
Old January 30th, 2005, 03:22 PM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Where am I going wrong?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT