What is this maddness(cpp)
1
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;
}
2
Name:
Anonymous
2009-05-12 21:16
Read SICP
3
Name:
Anonymous
2009-05-12 21:22
int main(){
loop:
goto loop;
}
4
Name:
Anonymous
2009-05-12 21:37
>>1
It should be fairly obvious what that fragment of code is doing...
5
Name:
Anonymous
2009-05-13 0:42
add return 0; at the end and it should start working.
6
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?
7
Name:
Anonymous
2009-05-13 4:11
>>1
goto
STOP PROGRAMMING!
8
Name:
Anonymous
2009-05-13 5:45
>>7
gb2 2009.
REAL MEN program like it's the 70's
9
Name:
Anonymous
2009-05-13 7:10
while(1) fork();
10
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).
11
Name:
Anonymous
2009-05-13 9:01
>>6
1/10
The
return statement in main may be omitted in Sepples.
12
Name:
Anonymous
2009-05-13 9:34
my power level is over 9000
13
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++.
14
Name:
Anonymous
2009-05-13 10:24
>>13
...in which case you couldn't include
iostream to begin with.
15
Name:
Anonymous
2009-05-13 10:49
16
Name:
Anonymous
2009-05-13 11:31
>>13
Omitting or including the .h affects used namespaces.
17
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).
18
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 .
19
Name:
Anonymous
2009-05-13 14:10
>>17
So what your saying is that
>>14,16 were totally right and your a stupid asshole.
20
Name:
Anonymous
2009-05-13 14:35
>>17
iostream.h is deprecated
[1] .
______________
[1] :
http://www.devx.com/tips/Tip/14447
21
Name:
Anonymous
2009-05-13 14:57
>>20
Sepples really should deprecate more of it's shit.
22
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.
23
Name:
Anonymous
2009-05-13 15:59
>>22
TIOOWTDI considered
pig disgusting .
24
Name:
Anonymous
2009-05-13 16:12
C++ should be deprecated.
25
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.
26
Name:
Anonymous
2009-05-13 22:02
>>25
Too bad the syntax for
scanf and
printf is
PIG DISGUSTING
27
Name:
Anonymous
2009-05-13 22:06
>>26
PLZ CAN I TO MAKE COUT SHIFT ENDL BITS RIGHT, MKEY?
28
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.
29
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!
30
Name:
Anonymous
2009-05-13 22:45
LOL NAMESPCE
31
Name:
Anonymous
2009-05-13 22:53
>>29
why the fuck would you use slow as fuck
scanf instead of
fgetln or
fgets?
32
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
33
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;
34
Name:
Anonymous
2009-05-13 23:05
Shit. EXPERT FAIL QUOTER
35
Name:
Anonymous
2009-05-13 23:07
:: makes no sense, what's the point of namespaces
36
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.
37
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.
38
Name:
Anonymous
2009-05-13 23:33
>>33
char *str;
str = getline("Enter your family name: ");
39
Name:
Anonymous
2009-05-13 23:33
40
Name:
Anonymous
2009-05-13 23:35
>>39
Lrn2
Back to /b/, please.
Newer Posts