Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 90
Search took 0.01 seconds.
Search: Posts Made By: brkstf
Forum: C++ May 19th, 2005, 4:22 PM
Replies: 24
Views: 736
Posted By brkstf
i could be wrong, but doesn't the "sieve" method...

i could be wrong, but doesn't the "sieve" method require an array of integers the size of the range. for instance, if we wanted to find all primes between 2 and 20, we make an array with 19 members,...
Forum: C++ May 17th, 2005, 6:29 PM
Replies: 18
Views: 418
Posted By brkstf
it's a total ripoff and everyone knows it. the...

it's a total ripoff and everyone knows it. the biggest ripoff is the "edition" scam.

publisher makes a "new" edition with an expanded 8th chapter and different numbers in the problem sets,...
Forum: C++ May 17th, 2005, 11:57 AM
Replies: 18
Views: 418
Posted By brkstf
95 bucks! good grief

95 bucks! good grief
Forum: C++ May 16th, 2005, 5:28 PM
Replies: 24
Views: 736
Posted By brkstf
the elegance of saving an instruction is quickly...

the elegance of saving an instruction is quickly overshadowed by the bad algorithm. somewhere around the 4td or 5th prime number found, thomzor's strategy will be better than yours in terms of...
Forum: C++ May 16th, 2005, 11:49 AM
Replies: 18
Views: 418
Posted By brkstf
at the university of california, the dietels'...

at the university of california, the dietels' book is used for c++.

it's a good, and very complete book, but a lot of stuff is not in the best order for learning. when i took c++ at the uni, we...
Forum: C++ May 12th, 2005, 8:09 PM
Replies: 11
Views: 402
Posted By brkstf
yah, i'm stupid. c++ doesn't have a byte...

yah, i'm stupid. c++ doesn't have a byte type.

char something=char(0);
do{cout<<char(something++);}while(something);

that works though.
Forum: C++ May 12th, 2005, 5:06 PM
Replies: 11
Views: 402
Posted By brkstf
how about: byte...

how about:

byte something=0;
do{cout<<char(something++);}while(something);


that should end when 11111111 gets incremented, i think.
anyone have a more optimized way?
Forum: C++ May 12th, 2005, 3:48 PM
Replies: 11
Views: 402
Posted By brkstf
you can also do this using bytes, iterating the...

you can also do this using bytes, iterating the bytes, and outputing them by casting them as chars. something like this

byte someThing=0;
for(int x=0; x<256; x++)
{
cout <<char(byte);
byte++;
}

of...
Forum: C++ May 10th, 2005, 1:21 AM
Replies: 27
Views: 571
Posted By brkstf
sorry if it was bad form to just post some code,...

sorry if it was bad form to just post some code, but it certainly didn't seem like a school project. ;) anyway, no offense taken.

suggesting that a newbie learn c++ for a project like that is a...
Forum: C++ May 7th, 2005, 4:44 PM
Replies: 27
Views: 571
Posted By brkstf
dammit. i typed this once. do it in perl or php...

dammit. i typed this once. do it in perl or php or something.

in perl, it's basically this

#!/usr/bin/perl
use...
Forum: C++ May 2nd, 2005, 4:36 PM
Replies: 4
Views: 204
Posted By brkstf
do it d&d style if you ever played, you would...

do it d&d style

if you ever played, you would remember how they'd have weighted probabilities based on using several dice at once. for example, using a certain weapon might de 2d4 damage, meaning...
Forum: Community Introductions Apr 26th, 2005, 6:46 PM
Replies: 13
Views: 240
Posted By brkstf
a four-year coding degree will teach you a lot of...

a four-year coding degree will teach you a lot of very difficult, nearly useless stuff. but you will have a HUGE advantage getting a job.

my good friend got his degree in CS and pretty much got...
Forum: C Apr 25th, 2005, 12:09 PM
Replies: 22
Views: 469
Posted By brkstf
when i was taking c++ in school, i was taught...

when i was taking c++ in school, i was taught that c++, by design, is a superset of c, which is to say that it contains ALL of c, plus more. and that any valid c code will compile as c++.

is this...
Forum: C Apr 22nd, 2005, 1:46 PM
Replies: 10
Views: 357
Posted By brkstf
^ what he said

^
what he said
Forum: C Apr 22nd, 2005, 1:43 PM
Replies: 10
Views: 357
Posted By brkstf
2^16=65536 65536/2= 32768 since ints can be...

2^16=65536
65536/2= 32768

since ints can be negative, the range is -32767 to 32768, apparently, on your compiler.

it's weird that an int on your system is only 2 bytes, but there is your problem....
Forum: C++ Apr 21st, 2005, 11:15 AM
Replies: 5
Views: 199
Posted By brkstf
the logical way is to have a Creature class with...

the logical way is to have a Creature class with flags for bipedalism, lightemittance, etc.

include ALL of the various methods in the class definition, making sure to implement them in such a way...
Forum: C++ Apr 21st, 2005, 11:03 AM
Replies: 6
Views: 310
Posted By brkstf
thanks again. this does exactly what i need it...

thanks again. this does exactly what i need it to do, and MUCH easier than malloc-ing. went through this section in my dietel book and i'm much happier. and that delete[] is sweet, too.
Forum: C++ Apr 20th, 2005, 6:28 PM
Replies: 21
Views: 397
Posted By brkstf
i like char*, myself. it makes more sense to...

i like char*, myself. it makes more sense to me.

i like to think of a char* as a separate data type.

but then again, i put my opening braces on the next line for symmetry, which we can also...
Forum: C++ Apr 20th, 2005, 1:28 PM
Replies: 6
Views: 310
Posted By brkstf
thanks, eggbert. can N be a variable, and can...

thanks, eggbert.

can N be a variable, and can that array be created at runtime?
Forum: C++ Apr 19th, 2005, 6:55 PM
Replies: 6
Views: 310
Posted By brkstf
malloc and new

i was wondering how you all feel about using malloc in C++ coding.

let's say i ask the user how many people there are in his neighborhood, and input int numberofNeighbors, for use with some neighbor...
Forum: C++ Apr 19th, 2005, 6:30 PM
Replies: 4
Views: 219
Posted By brkstf
i don't have time to help you much, but let me...

i don't have time to help you much, but let me suggest the following.

every once in a while, write a status line to a flat text file. then, execute the program. read the output file to figure out...
Forum: C++ Apr 19th, 2005, 6:26 PM
Replies: 12
Views: 243
Posted By brkstf
seriously, can you just scan in a copy of the...

seriously, can you just scan in a copy of the equation and post that, cuz the one you have written doesn't make any sense to me.
Forum: C++ Apr 19th, 2005, 6:21 PM
Replies: 12
Views: 243
Posted By brkstf
i'm sorry i don't understand exactly what you...

i'm sorry i don't understand exactly what you mean, but is there a problem with just following this pseudocode:

float p(float, float);/ /function prototype

float a=0;// initial value of a
float...
Forum: C++ Apr 18th, 2005, 3:31 PM
Replies: 6
Views: 226
Posted By brkstf
http://www.lovett.org/~dgraham/Lesson%2014 everyt...

http://www.lovett.org/~dgraham/Lesson%2014

everything you want to know about ifstream objects
Forum: C++ Apr 18th, 2005, 1:37 PM
Replies: 6
Views: 246
Posted By brkstf
to be fair, they might not have taught it because...

to be fair, they might not have taught it because it's difficult to read and create. also, it's not particularly necessary unless for some reason you have an extremely tight memory problem which...
Forum: C++ Apr 18th, 2005, 11:18 AM
Replies: 31
Views: 775
Posted By brkstf
just buy a freakin book. i don't know what other...

just buy a freakin book.

i don't know what other people here think, but there is something about having a nice well-worn, dog-eared, c++ book on your desk. maybe i'm just old, but i find an actual...
Forum: C++ Apr 17th, 2005, 5:50 PM
Replies: 11
Views: 249
Posted By brkstf
it's really bad form to use a string to hold one...

it's really bad form to use a string to hold one character.

a char will do just fine.
Forum: C++ Apr 16th, 2005, 12:38 PM
Replies: 8
Views: 227
Posted By brkstf
here's some simple code for the structure. it...

here's some simple code for the structure. it will accept any type of two-argument, one-operator math, separate it into its tokens, and then math the hell out of them.

hope it comes out alright...
Forum: C++ Apr 16th, 2005, 12:56 AM
Replies: 8
Views: 227
Posted By brkstf
stdlib.h has a function called atoi and another...

stdlib.h has a function called atoi and another called atof

atoi will convert a character string to an integer and atof will convert it to a float.

honestly, it's almost always better for cin to...
Forum: Coder's Corner Lounge Apr 14th, 2005, 6:17 PM
Replies: 637
Views: 18,451
Posted By brkstf
perl: $start=1; while(11-($start)) {print...

perl:

$start=1;
while(11-($start))
{print $start++;}
Forum: C++ Apr 13th, 2005, 11:27 AM
Replies: 14
Views: 628
Posted By brkstf
ahhh, i misunderstood you. i thought you were...

ahhh, i misunderstood you.

i thought you were building an actual machine type thing. like with a video camera and robotic arm. you're actually building a software bot. sounds like a cool project...
Forum: C++ Apr 12th, 2005, 4:00 PM
Replies: 14
Views: 628
Posted By brkstf
the pushbuttons() i can help with. haven't done...

the pushbuttons() i can help with.

haven't done much in the way of readcards(), though.

basically, how it works is this. you have to build some sort of device that can accept data from your...
Forum: C Apr 12th, 2005, 2:10 PM
Replies: 1
Views: 310
Posted By brkstf
define statements only tell the pre-processor to...

define statements only tell the pre-processor to substitute one text string for another. you have declared it wrong.

to make something truly global, declare it BEFORE main, outside of any braces....
Forum: C++ Apr 12th, 2005, 1:46 PM
Replies: 14
Views: 628
Posted By brkstf
#include "robotVision.h" #include...

#include "robotVision.h"
#include "pushButtons.h"
#include "poker.h"

while (gameStatus)
{
new Cards thisHand= readcards();
thisHand.getstrategy();
thisHand.strategy.pushbuttons();
check (gameStatus);
Forum: C++ Apr 11th, 2005, 4:08 PM
Replies: 14
Views: 769
Posted By brkstf
fess up. how many of you have started doing this...

fess up. how many of you have started doing this project because of this thread? i'll admit that i'm about 150 lines into it.

no offense, rei, but i haven't the foggiest idea what you're talking...
Forum: C++ Apr 11th, 2005, 3:49 PM
Replies: 57
Views: 1,484
Posted By brkstf
one other thing: no one ever made a php...

one other thing:

no one ever made a php interpreter for MacOS. :(
That's probably the main reason I never got into it. Maybe now that I'm getting an OS X box, i might re-enter the php world. i...
Forum: C++ Apr 11th, 2005, 3:28 PM
Replies: 57
Views: 1,484
Posted By brkstf
i love perl, for some things. here's one of...

i love perl, for some things. here's one of them:

#!/usr/bin/perl
use LWP::Simple;
getstore ($source, $destination);

voila! you snatched a web page in three lines.

also, it's capacity for ugly...
Forum: C++ Apr 11th, 2005, 11:38 AM
Replies: 4
Views: 134
Posted By brkstf
abstraction refers to a process of making your...

abstraction refers to a process of making your code more like thought and less like assembly language.

a typical example would be overloading your operators and object methods so that your main()...
Forum: C++ Apr 9th, 2005, 3:27 PM
Replies: 3
Views: 158
Posted By brkstf
the first thing i notice is that your seat array...

the first thing i notice is that your seat array only has 9 members, when it should have ten.

also, when you have a choice, don't input an INT when you could be inputting a CHAR. it's an...
Forum: C++ Apr 8th, 2005, 12:55 PM
Replies: 57
Views: 1,484
Posted By brkstf
learning another language, particularly a very...

learning another language, particularly a very high level lang like perl is VERY useful. i didn't say it was a bad idea. in fact, i program a LOT more in perl than in C++. often, it's the...
Showing results 1 to 40 of 90

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:47 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC