[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 13 KB, 398x444, Untitled.png [View same] [iqdb] [saucenao] [google]
2008998 No.2008998 [Reply] [Original]

sort of homework help, sort of not
the main problem is I don't understand what she wants this code to do
and there's so little code actually in the question

>> No.2009007

DC.f takes char[], but bitch is giving her a float.

>> No.2009020

>>2008998
>consider the code below: propose correction of errors if any. if comment line, clarify the statement purpose and correctness:

oh my god

>> No.2009028

Every non-trivial class needs a constructor and destructor method.

>> No.2009042

in the class definition for DC, f is defined to take char; but when implemented in main, she plugs in rounded pi, which is a double not a char

>> No.2009069

Overload the .f( ) function and make it a template.

>> No.2009082

Doesn't C++ allow multiple functions with the same name as long as their parameters are different? If so there's nothing I see wrong here.

>> No.2009086

>C++
>not VB master race

>> No.2009095

>>2009082
He has to declare the functions "virtual" if he is going to use them with the same name in an inherited environment.

>> No.2009146
File: 20 KB, 829x417, Untitled.png [View same] [iqdb] [saucenao] [google]
2009146

>> No.2009171

>>2009086
>Not C/assembly master race

>> No.2009177

>>2009171

HOLY SHIT? people still code in assembly language? why? just because? need someone to hook you up with a working c64 or something man?

>> No.2009184

>>2009086
>VB

serious? Python is more capable than that

>> No.2009198

change char [] -> const char*
and then put "s around the 3.14

>> No.2009201

>>2009184
Yes, lets make this a programming language arguement thread

>> No.2009202

>>2009177
small footprint, and when code needs to be fast, take it to the lowest level.

>> No.2009212

>>2009177
You can't stick a pentium5 in everything bro. If you want your webcam / guided missile / cell phone / 3d engine / anything that's got to be really fucking efficient, you use assembly.

>> No.2009215

test

>> No.2009220

at first glance i thought virtual that BC function, but then i thought cus it's overloaded it doesn't matter.

Now i'mconfused cus DC inherits BC functions and i think that code should work...

Someone explain to me how i am wrong plase?

>> No.2009226

>>2009177
I guess if they're really cheap and want to buy a 16k chip for their Integrated circuits
Need to do something very specific that would benefit from the extra speed
or want to get the most bang out of their buck for their super computers
or if you want to write a computer virus
oooor if you want to hack an encrypted application
No sane person would program anything in assembly from scratch though
only small things

>> No.2009279

>>2009212
I mostly agree, however
>guided missile
pretty sure they spend enough money on each one that they wouldn't mind dropping another $25 on a ~2.2ghz intel/AMD chip that's newer than Pentium 5

>> No.2009297
File: 66 KB, 500x328, 20080708-MoreYouKnow.jpg [View same] [iqdb] [saucenao] [google]
2009297

>>2009202
>>2009212
>>2009226
>>2009279

i had no idea. i guess that i am living in the jetson's future

>> No.2009338

>>2009297
theres never gonna be a time where optimization wont matter, ever.

>> No.2009369

>>2009338
ya, in 50 years the singularity computer matrix will constantly be worried about increasing its computational efficiency from 10^99999999 floating point operations per second to 10^99999999+1 floating point operations per second

>> No.2009378

>>2009369
by then we would have applications that would need that speed, and utilize it to its FULLEST power.

>> No.2009382
File: 12 KB, 126x126, 1278541306998.jpg [View same] [iqdb] [saucenao] [google]
2009382

>C++

>> No.2009410

>>2009378
>fails to understand how large the number 10^99999999 is

>> No.2009419

>>2009410
I don't think that number is even possible in reality. There probably aren't that many planck volumes in the entire universe.

>> No.2009425
File: 28 KB, 400x400, 16465345349897.jpg [View same] [iqdb] [saucenao] [google]
2009425

>>2009419
>mfw he thinks numbers can be in reality

>> No.2009421

>>2009410
>fails to realize that the ratio of speed of optimized vs. unoptimized operations will stay the same

>> No.2009431

>>2009425
I lold so fucking loud just now
nicely done

>> No.2009432

>>2009425
>my face when you're obviously trolling
>implying it isn't possible to have one discrete unit of something

>> No.2009434
File: 26 KB, 300x291, 300px-Robert_Zubrin.jpg [View same] [iqdb] [saucenao] [google]
2009434

WTF you doing here...
>>>/prog/
now GTFO

>> No.2009449
File: 22 KB, 544x400, 1286335110695.jpg [View same] [iqdb] [saucenao] [google]
2009449

>>2009432
>mfw when saying that there is a discrete unit of something is a description of reality and not reality in itself

>> No.2009462
File: 7 KB, 251x244, 1288409524816.jpg [View same] [iqdb] [saucenao] [google]
2009462

>>2009449
Just admit you knew what I meant, and are just being a faggot.

>> No.2009472

Assembly is also commonly used under the hood like in real time applications to do something like draw the courser on your screen or control your anti lock breaks or modulate the signals coming out of your cellphone. A good programmer can wright assembly knowing the timing of execution to the clock cycle. Besides it's just so much fun to reach up under a computers skirt and fiddle with her registers.

>> No.2009477

>>2009449
So math is a lie, then.

>> No.2009503

>>2009477

Math made up. It is true because it is defined to be true. It just happens to be useful when describing the world..

>>2009462

I admit to being a faggot.