Your browser does not seem to support CSS. If images appear below, please disregard them.
Page 2 of 2   < 1 2
Topic Options
Rate This Topic
#17372 - 01/04/04 06:51 AM Re: First Program (What u think)
Joined: Dec 2003
Posts: 38
acid45 Offline
Junior Member
acid45 Offline
Junior Member

Joined: Dec 2003
Posts: 38
canada
Quote:

oh, i just read your other program. Thats not how you stop it so you can see it, you are just wasting memory (not like its a lot but hey, its better you dont get used to it now that you are startin to learn).
#include "conio.h"
getch(); //that will pause till you press a key
wouldn't including stdlib.h and using system("pause"); be a little less coding. You could even define it as something like:
Code:
#define PAUSE system("pause")
and then go to use it like this:
Code:
main()
{
PAUSE;
}
and it would come out like this:
"Press any key..."
or similar message

Top
Sponsored Links
#17373 - 01/14/04 06:18 PM Re: First Program (What u think)
Joined: Aug 2003
Posts: 240
paradox Offline
Member
paradox Offline
Member

Joined: Aug 2003
Posts: 240
New Zealand
very unoptomized code would be slow as hell.. but you will learn you taken the 1st step thats what counts so stop criticizing him :p


The wise make mistakes, the fools repeat them
----------------------------------------
When you have eliminated the impossible, that which remains, however improbable, must be the truth
Top
#17374 - 01/15/04 03:50 AM Re: First Program (What u think)
Joined: Aug 2002
Posts: 68
Scalli0n Offline
Junior Member
Scalli0n Offline
Junior Member

Joined: Aug 2002
Posts: 68
C++ is fun. I suggest you get this book:

http://www.amazon.com/exec/obidos/tg/det...ks&n=507846

Very good. very good stuff indeed.

That and read some online tutorials. Write some neat code, have some cool fun. Oh, pergesu has good stuff to (find his profile, he's got links in it) and uhm uhm uhm other than that check out http://www.allegro.cc when you want to do low-level graphics programming.

And learn java too.

Top
#17375 - 01/15/04 06:55 AM Re: First Program (What u think)
Joined: Dec 2003
Posts: 17
AnthonyVSD Offline
Junior Member
AnthonyVSD Offline
Junior Member

Joined: Dec 2003
Posts: 17
BC, Canada
Coleman, if you don't know what you'll be able to do by being able to program C/C++, it's likely that there isn't much point in you learning it. If you'd just like to play around on the web, I suggest learning the basics first. Start with XHTML and PHP.


Anthony Gorecki
"Freedom through knowledge."
Top
#17376 - 02/06/04 03:57 PM Re: First Program (What u think)
Joined: Feb 2004
Posts: 5
simon Offline
Junior Member
simon Offline
Junior Member

Joined: Feb 2004
Posts: 5
shanghai
It's a example.Perhaps this example teaches the reader the application of the key word"if... else if...else". I think so.

Top
#17377 - 02/07/04 01:05 PM Re: First Program (What u think)
Joined: Oct 2003
Posts: 209
Red Mage Offline
Member
Red Mage Offline
Member

Joined: Oct 2003
Posts: 209
here.
Coleman: get to Dev C++ It's good

Ice: use something like this.. {variable = rand() % max;}
It'll give you a random number between 0 & "max"(which should also be replaced). I don't really know much about how it works, since I don't actually program in C++ :-D


Those who say do not know.
Those who know do not say.
Top
#17378 - 02/07/04 05:26 PM Re: First Program (What u think)
Joined: Jan 2004
Posts: 6
vooduhal Offline
Junior Member
vooduhal Offline
Junior Member

Joined: Jan 2004
Posts: 6
TN, USA
variable = rand() % max;

rand() produces a random integer value.
% is called the modulus operator. It's basically what you learned to be the remainder in division. Ie. 5 % 3 = 2 and 16 % 5 = 1
As for this function, it actually only returns a number from 0 to max - 1, as you can't divide a number by a number and have the remainder equal to the divisor. Ie. a % b cannot equal b.

Top
Page 2 of 2   < 1 2

Member Spotlight
Crime

Crime
SC, usa
Posts: 506
Joined: March 2002
Show All Member Profiles 
Sponsored Links
Forum Statistics
Forums46
Topics46,477
Posts81,647
Members2,157
Most Online1,567
Apr 25th, 2010
Latest Postings
Top Posters(All Time)
UGN Security 39,641
Gremelin 7,195
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860