It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by ">User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a ">Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
Page 1 2
#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

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:
#define PAUSE system("pause")
and then go to use it like this:
and it would come out like this:
"Press any key..."
or similar message

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

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
#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:

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 when you want to do low-level graphics programming.

And learn java too.

#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."
#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
It's a example.Perhaps this example teaches the reader the application of the key word"if... else if...else". I think so.

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

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

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.
#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
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.

Page 1 2

Member Spotlight
Portland, OR; USA
Posts: 7,202
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Average Daily Posts0
Most Online1,567
Apr 25th, 2010
Latest Postings
by Cyrez on 12/16/17 09:19 AM
Okay WTF?
by HenryMiring on 09/27/17 08:45 AM
The History Thread...
by Gremelin on 08/11/17 07:11 PM
my old account still exists!
by Gremelin on 08/11/17 07:02 PM
My friend NEEDS your HELP!
by Lena01 on 07/21/17 07:06 AM
I'm having fun with this guy.
by gabithompson730 on 07/20/17 08:50 AM
I want to upgrade my phone
by gabithompson730 on 07/20/17 08:49 AM
Top Posters(All Time)
UGN Security 41,392
Gremelin 7,202
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 3
Black Beard Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
fleshwound Likes: 1
Ghost Likes: 2
Gremelin Likes: 12
Ice Likes: 1
ninjaneo Likes: 1
Powered by UBB.threads™ PHP Forum Software 7.6.0
(Snapshot build 20170206)