Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ assist

Name: C++ Noob 2010-09-23 23:58

Ok so I am learning C++ and I suck.

Trying to add 1/1 + 1/2 + ... + 1/99 + 1/100

The problem is I can't get the denominator to increase as I attempt to add them.
Anyone care to point out my most likely obvious mistake?

This is what I have


#include <iostream>

using namespace std;

void main ()
    {
    const    long    MaxNum (100);
    double    i;
    double    Sum;
    double    x;
    for (x = 1, i = 1/1, Sum = 0; x <= MaxNum; x++)
        Sum += i;
    cout << "Sum is " << Sum << endl;
}

Name: Anonymous 2010-09-24 11:41

C++ PROGRAMMERS ARE ALL RETARDS. I HATE C++ PROGRAMMERS SO MUCH. I LOL AT HOW THEY MAKE THINGS PRIVATE IN CLASSES BUT THEY ARE CLASSES THAT THEY ARE JUST USING THEMSELVES. STOP BEING A FAG. DONT THEY TRUST THEMSELVES>??? OOOOH IVE GOT TO PROTECT THE VARIABLSE.

FUCK U C++. I AM A SUPER COOL PROGRAMMER AND I CAN HANDLE HAVING ACCESS TO EVERYTHING I AM USING. IF IM NOT MEANT TO USE IT, I WONT. IM NOT SOME FAG THAT CANT BE TRUSTED AND HAVE TO HAVE THE PRIVACY ENFORCED. ENJOY YOUR WASTED HOURS WRITING GET AND SET METHODS FAG WHILE IM WRITING AMAZING CODE AND HAVING SEX WITH MODELS AND SNORTING COCAINE OFF THEIR TITS.

Name: Anonymous 2010-09-24 11:59

>>13
#define private public

Name: Anonymous 2010-09-24 12:06

>>13
this is copypasta. i can tell from having written this text last year sometime

Name: Anonymous 2010-09-24 12:13

>>16
Thanks Sherlock. Now I have another case where I have to rely on your special abilities...

Name: VIPPER 2010-09-24 12:15

>>16
dude, give me some of that coke.

Name: Anonymous 2010-09-24 13:04

>>17
where is original thread

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List