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

Pages: 1-4041-

Can't Fix Error in my Program (C++)

Name: Anonymous 2012-11-21 20:34

Hello, I have an error in a program I wrote, and I can't figure out what I did wrong. Could someone please take a look at it for me? It would be much appreciated.

The code was too many lines to post here, so please read it:

http://www.daniweb.com/software-development/cpp/threads/440954/

Name: Anonymous 2012-11-21 20:47

Name: Anonymous 2012-11-21 20:52

The error itself is sepples, use C or Lisp.

Name: Anonymous 2012-11-21 21:13

>>2-3 read the thread, geniuses.

Name: Anonymous 2012-11-21 21:19

>>4
Solve your own problem, genius.

Name: Anonymous 2012-11-21 21:20

>>4
Are you dense, motherfucker?

Go back to your imageboard.

Name: Anonymous 2012-11-21 21:47

>>2-3,5-6
Jesus, when did /prog/riders get this dumb?
Good job, you've managed to ruin one of the funniest things I've read all year. I'm ashamed I even tried to amuse you faggots.
If you spent three seconds looking at the thread I linked, you'd be clutching your sides in laughter right now. Instead, you went "OH BOY A THREAD ASKING FOR ADVICE BETTER TELL HIM TO FUCK OFF DO I FIT IN YET? LEL HAVE YOU READ YOU'RE SICP TODAY THAT IS SO FUNNY MY OTHER CAR IS A CDR CAN'T STOP LAUGH" like you all just discovered this board yesterday.

Have none of you ever seen the "OP pretends to be the poster of the article he is linking" format for a thread? Seriously? I thought I could write something ever so slightly more clever than ``Lol guys check out this idiot he can't code WTF am I reading lol'' but apparently, the average /prog/rider these days is too dense to get even that kind of ``joke'' without having it completely spelled out for them.
Get the fuck out of /prog/ and never come back, all of you.

Name: Anonymous 2012-11-21 21:56

oh my god this is horrendous

then I realized IHBT

Name: Anonymous 2012-11-21 22:09

>>2-3,5-6
Monkeys.
I haven't read the thread in OP's post, but I have laughed at you.

Name: Anonymous 2012-11-21 22:21

for(ii = 0; ii < 1; ii++)
{
if(phi == 1)
{
cout<<endl;
cout<<"Random Number: "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 2)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 3)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 4)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 5)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}

Name: Anonymous 2012-11-21 22:23

The sad part is how much time this most likely took you to write 4,000 lines of bullshit. That said, posting it "for the lulz" on a legitimate programming website asking for assistance is an asshole move.

tl;dr OP = faggot

Name: Anonymous 2012-11-21 22:24

this nigga never heard the old saying:
two or more, use a for!

int x;
int xx;
int xxx;
int xxxx;
int xxxxx;
int xxxxxx;
int xxxxxxx;

Name: Anonymous 2012-11-21 22:25

This kind of logic is typical of COBOL programmers. Except in COBOL you don't get the luxury of a compiler with halfway decent error messages. Everything is global and anything can modify anything else.

I've seen much scarier code. This should be easy to fix.

Name: Anonymous 2012-11-21 22:26

I could do this in about five lines of Haskell

Name: Anonymous 2012-11-21 22:28

>>12

3/4 or more seems more legit, 2 vars isn't quite enough to ujstify a for

Name: Anonymous 2012-11-21 22:29

>>14

>faggots on prog pretending shit, outdated languages are useful for anything now

Name: Anonymous 2012-11-21 22:59

Well this is quite a large program

I stopped reading right there.

Name: Anonymous 2012-11-21 23:30

>>14

And I could probably do it in 4 with Ruby, but it would look VERY ugly, and everything would be a giant mess of message passing and blocks. Also, every line would be over a thousand characters long.

Name: Anonymous 2012-11-21 23:32

>>7
XDDDD E/G/IN WIN /G/ROW XD XD

Name: Anonymous 2012-11-22 0:03

>>19
WTF does that even mean?

Name: Anonymous 2012-11-22 0:05

>>20
ONLY 90's KIDS WILL UNDERSTAND!!!!1 AMIRITE GUISE XD

Name: Anonymous 2012-11-22 0:31

>>1
Trold xD

Name: Anonymous 2012-11-22 2:38

So I ran it all through a couple of reformatting scripts and fixed the compile errors. Check this out.

//              PRINT DECLARATION

void Text::Write() {
    string c;
    cout << "->";
    getline(cin, c);
    getline(cin, c);
    cout << endl;
    cout << endl;
    cout << "---------|\t\t" << c << "\t\t|---------" << endl;
    cout << endl;
    cout << endl;
}


He dedicated one of the features of his program to reading two lines of text, discarding the first, and printing the second with a stupid margin outline effect. Either he's a mad genius or (judging by the path to the file mentioned in the original thread) an employee at a company I want nothing to do with, ever.

Or he's just trying desperately to learn C++, and keeping all his shit in the same file for some reason.

Name: Anonymous 2012-11-22 10:32

>>7
Should have titled it EXPERT C++ PROGRAMMER [4000 LINES OF PUSSY AND ASS]

Name: Anonymous 2012-11-22 11:23

>>7,9
e/b/in win >>1-san

Name: Anonymous 2012-11-22 12:37

What's wrong with his code? It should be fast, he unrolled all his loops!

Name: Anonymous 2012-11-22 12:42

http://www.daniweb.com/members/1024170/Pseud0nymous
Okay motherfuckers. Which one of you was it? Own up.

Name: Anonymous 2012-11-22 13:06

>>27
It's like we're really on Reddit.

Name: Anonymous 2012-11-22 14:50

>>27
I'm the guy who postes that copypasta when someone mentions Javashit or something as stupid as Javashit, like /g/.

Wasn't me.

Name: Anonymous 2012-11-22 19:07

>>1
Related Article: Interview with Bjarne Stroustrup, Creator of C++

Name: Anonymous 2012-11-22 19:41

>>30
My
fucking
sides.

Name: Anonymous 2012-11-24 10:14

Bump for help :(

Name: Anonymous 2012-11-24 10:17

>>32
You should just dump it and start again. Next time, consider splitting up your program into different files, where each file contains code with related functionality. Also, compiler error messages are incredibly helpful - they tell you exactly what went wrong where.

Name: Anonymous 2012-11-24 10:34

>>27
That was me. What are you going to do about it, nerd?

Name: Anonymous 2012-11-24 15:14

>>32
Go back to your C++ text book and review the flow control operators (for, while, etc). Think about the logical steps of work in your program (for example, one step might be: printing a prompt message, reading a value from cin, and storing the value in a variable). Then break those steps into separate functions and invoke them each time they're needed. This will reduce the amount of redundant code in your file. HTH :)

Name: Anonymous 2012-11-24 21:12

>>23
Java style braces
Back to /code/g/[/code], bitch.

Love, Horstmann style master race

Name: Anonymous 2012-11-24 21:14

>>36
[code]
Back to Reddit, please.

Name: Anonymous 2012-11-24 21:15

>>37
Err, I mean
/code/.

Name: Anonymous 2012-11-24 21:36

>>36

void f(){
    e1;
    e2;
    e3;}

Name: Anonymous 2012-11-24 22:31

>>39
[code]void f()
{   e1;
    e2;
    e3;
}

Name: Anonymous 2012-11-25 11:07

void f() {
  u;
  c;
  k;
}

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