langston's ant in C++

Keltus
09-14-2001, 09:43 PM
hi I'm making a langston's ant program in C++.

for those who don't know what it is, there is a page that describes it here -->
http://www.go2net.com/people/shaper/java/langston/

now I am very new to C++ and found that it's possible to use a windows 32bit application template to make a windows window. Now I'm a little bit confused about how to make a pixel on the screen... something like

pixel(5,5) should put a dot at 5,5

probably not like that but you wanted to know if anyone here knew :)

thanks for reading my question

"AAAHHHHHHH!!!! I can't stand this "junior contributor" title. Self esteem is going down....

BillSoo
09-14-2001, 09:59 PM
You should be able to call API functions from C++. So just use the SetPixel function to write and GetPixel to read.

There are also some native routines in the C language, but I forget what they are. They probably just encapsulate getpixel/setpixel anyway....



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

Keltus
09-14-2001, 10:10 PM
ok I see :)

I have a few more quick general questions about the language too....

first, why does C++ make so many files when it compiles, it seems like there are about 15... several in the main folder and several in the debug folder. that's kinda annoying if the only useful ones are the .cpp and the .exe

secondly, why are C++ programs so huge? I made a simple program like hello world with iostream.h and cout commands, and it was about 300k... I could make a batch file in like 30 bytes that does that, and a file in vb that's about 24kb and does it... with a bunch of gui too

is it because C++ incoporates the dlls and dependancy files into itself so it will run without extra libraries, unlike vb... if no, then how do I find out which files are needed, and what are some common ones?

"AAAHHHHHHH!!!! I can't stand this "junior contributor" title. Self esteem is going down....

BillSoo
09-14-2001, 10:17 PM
VB depends on the VBRuntime DLLs so the actual EXE can be relatively small. C++ has all the functions loaded within itself so it can be somewhat larger....

The extra files when compiling are temporary OBJ (object) files. They are like machine code images that the compiler makes, then the Linker links into an EXE.

"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

orufet
09-14-2001, 10:50 PM
If you compile with the free Borland compiler and notepad, all you have is the exe and the cpp files. But with Visual C++, it needs all of that other stuff.....

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

Thinker
09-15-2001, 07:10 AM
As I tried to explain to you in the chatroom, one of the main reasons for
the large size of the exe is all the debug information included. To make
a smaller, release version build, go to the Build menu/Set Active Configuration.
Select the release version in the listbox and OK. Build the project again.
You should have a Release folder now, with the smaller, release exe.

I think therefore I am... sometimes right. images/icons/wink.gif

taj134
09-24-2001, 03:13 AM
Hey Keltus,
just mentioning the prog i made in VB, so anyone that has seen this post and is intrested knows there is one done, in a totaly unrelated post, ie AI ALife. Download the attachment for the source code to make this program.
Toby

The Post (http://www.visualbasicforum.com/bbs/showflat.php?Cat=&Board=visbas&Number=51218&page=0&view=collapsed&sb=5&o=7&part=)

images/icons/cool.gif <font color=blue> Check out</font color=blue> Madtaj.com (http://www.madtaj.com) images/icons/cool.gif

Keltus
09-25-2001, 02:39 PM
I don't know why, but I can't get borland to work at all

I just tested a simple console wizard program like so:
#include &lt;iostream.h&gt;
void main()
{ cout &lt;&lt; "test/n"; }

I tried putting in using namespace std;
but that didn't help

[Linker Error] Unresolved external '__InitVCL' referenced from D:\BORLAND C++ 5 ENTERPRISE\LIB\CP32MTI.LIB|crtlvcl
[Linker Error] Unresolved external '__ExitVCL' referenced from D:\BORLAND C++ 5 ENTERPRISE\LIB\CP32MTI.LIB|crtlvcl
[Linker Error] Unresolved external 'WinMain' referenced from D:\BORLAND C++ 5 ENTERPRISE\LIB\C0W32.OBJ

it's weird cause that would work at my school's VC++ computers.... C++ is overwhelming


"AAAHHHHHHH!!!! I can't stand this "junior contributor" title. Self esteem is going down....

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum