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

What is this maddness(cpp)

Name: Anonymous 2009-05-12 21:10


#include <iostream>

using namespace std;

int main(){
    int i = 0;
   
    loop:
    cout << ++i << endl;
    if(i<5)
        goto loop;
}

Name: Anonymous 2009-05-12 21:16

Read SICP

Name: Anonymous 2009-05-12 21:22


int main(){
    loop:
    goto loop;
}

Name: Anonymous 2009-05-12 21:37

>>1
It should be fairly obvious what that fragment of code is doing...

Name: Anonymous 2009-05-13 0:42

add return 0; at the end and it should start working.

Name: Anonymous 2009-05-13 1:57

I didn't think the OP would be that... silly, to leave out a return statement. Is this what the state of Computer Science has become?

Name: Anonymous 2009-05-13 4:11

>>1
goto
STOP PROGRAMMING!

Name: Anonymous 2009-05-13 5:45

>>7
gb2 2009.
REAL MEN program like it's the 70's

Name: Anonymous 2009-05-13 7:10

while(1) fork();

Name: Anonymous 2009-05-13 8:42

What is this madness (C preprocessor)
It seems like you forgot the .h in the filename... unless it's really named that (but I don't think so).

Name: Anonymous 2009-05-13 9:01

>>6
1/10

The return statement in main may be omitted in Sepples.

Name: Anonymous 2009-05-13 9:34

my power level is over 9000

Name: Anonymous 2009-05-13 10:21

>>10
<iostream> is a system include, you don't need .h, unless you are really using C instead of C++.

Name: Anonymous 2009-05-13 10:24

>>13
...in which case you couldn't include iostream to begin with.

Name: Anonymous 2009-05-13 10:49

>>14
Good point.

Name: Anonymous 2009-05-13 11:31

>>13
Omitting or including the .h affects used namespaces.

Name: Anonymous 2009-05-13 12:32

>>13,14,16
Wrong, wrong, wrong.  No magic is invoked by the ``.h'' suffix, the preprocessor does not give a shit.  It's just the case that there are two different files (of which one might include the other).

Name: Anonymous 2009-05-13 12:49

>>17
Ever tried including iostream into your C programs and got away with it? (At compile that, that is.) Yeah, that's what I thought. IHBT.

Name: Anonymous 2009-05-13 14:10

>>17
So what your saying is that >>14,16 were totally right and your a stupid asshole.

Name: Anonymous 2009-05-13 14:35

>>17
iostream.h is deprecated[1].

______________

[1]: http://www.devx.com/tips/Tip/14447

Name: Anonymous 2009-05-13 14:57

>>20
Sepples really should deprecate more of it's shit.

Name: Anonymous 2009-05-13 15:23

>>21
Like stdio.h and string.h. Fucking Sepples programmers should start to actually use the facilities their favorite language provides, not something that was devised in '70.

Name: Anonymous 2009-05-13 15:59

>>22
TIOOWTDI considered pig disgusting.

Name: Anonymous 2009-05-13 16:12

C++ should be deprecated.

Name: Anonymous 2009-05-13 16:15

>>22
Using Sepples streams are twice as slow as using scanf and printf. Sorry, "type safety" isn't a good enough excuse to make me slow down my program on purpose for no good reason at all.

Name: Anonymous 2009-05-13 22:02

>>25
Too bad the syntax for scanf and printf is PIG DISGUSTING

Name: Anonymous 2009-05-13 22:06

>>26
PLZ CAN I TO MAKE COUT SHIFT ENDL BITS RIGHT, MKEY?

Name: Anonymous 2009-05-13 22:13

>>25
Let's see the numbers faggot. Oh wait, they don't exist. Hope you enjoy your buffer overflow.

Name: Anonymous 2009-05-13 22:15

char str[80];

printf ("Enter your family name: ");
scanf ("%s",str);


VS

string str;
std::cout << "Enter your family name: ";
std::cin >> str;


Look how PIG DISGUSTING that C syntax is!

Name: Anonymous 2009-05-13 22:45

LOL NAMESPCE

Name: Anonymous 2009-05-13 22:53

>>29
why the fuck would you use slow as fuck scanf instead of fgetln or fgets?

Name: Anonymous 2009-05-13 23:00

>>29
MY COMPILER IS ONE HUNDRED AND THIRTY KB PURE LEAN CODE
ONE KEYSTROKE AND I`LL OVERFLOW YOUR BUFFER

Name: Anonymous 2009-05-13 23:04

>>31
fgetln [o]
fgets

Even more PIG DISGUSTING.

char str[80];

printf ("Enter your family name: ");
fgets (str, 80 , stdin);


VS


string str;

std::cout << "Enter your family name: ";
std::cin >> str;

Name: Anonymous 2009-05-13 23:05

Shit. EXPERT FAIL QUOTER

Name: Anonymous 2009-05-13 23:07

:: makes no sense, what's the point of namespaces

Name: Anonymous 2009-05-13 23:19

>>33
Now try to do something realistic with it, and watch that Sepples style blow up to 10 lines of formatting operations interspersed with data.  Then try to localize it.

Name: Anonymous 2009-05-13 23:26

>>36
This thread was only about Sepples streams vs stdio.h. Irrelevant!

Also I could do it in pure C in Sepples if what you said was true, but it isn't.

Name: Anonymous 2009-05-13 23:33

>>33
char *str;

str = getline("Enter your family name: ");

Name: Anonymous 2009-05-13 23:33

>>37
Moron.  Lrn2read.

Name: Anonymous 2009-05-13 23:35

>>39
Lrn2
Back to /b/, please.

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