What is the C programming equivalent of...
1
Name:
Anonymous
2010-09-04 13:34
String newline = System.getProperty("line.separator");
2
Name:
Anonymous
2010-09-04 13:42
1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘newline’
3
Name:
Anonymous
2010-09-04 13:47
'\n'
4
Name:
sage
2010-09-04 14:41
Always use '\n' unless you're dealing with Windows. In that case, don't code a damned thing.
5
Name:
Anonymous
2010-09-04 15:05
(native-eol-style
6
Name:
Anonymous
2010-09-04 15:57
>>1
"\n" actually works just fine when you write to a file opened in text mode. Windows takes care of changing it to
"\r\n". I'm not arguing whether that sort of behaviour is sensible.
7
Name:
Anonymous
2010-09-04 15:59
What is the C programming equivalent of...
System.gc();
8
Name:
Anonymous
2010-09-04 16:31
9
Name:
Anonymous
2010-09-04 17:32
10
Name:
Anonymous
2010-09-04 19:17
11
Name:
Anonymous
2010-09-04 19:26
What is the C programming equivalent of...
System.currentTimeMillis();
12
Name:
Anonymous
2010-09-04 19:52
13
Name:
Anonymous
2010-09-04 19:57
What is the C programming equivalent of...
fibo :: Int -> Maybe Integer
fibo n = undefined?
14
Name:
Anonymous
2010-09-04 21:08
What is the C programming equivalent of...
*
"GRUNNUR"
;
15
Name:
Anonymous
2010-09-04 21:15
>>13
#include <error.h>
#include <stdlib.h>
void fibo(int n) {
fprintf(stderr, "*** Exception: Prelude.undefined\n");
exit(EXIT_FAILURE);
}
16
Name:
Anonymous
2010-09-04 21:31
17
Name:
Anonymous
2010-09-04 21:41
18
Name:
Anonymous
2010-09-05 0:23
19
Name:
Anonymous
2010-09-05 4:55
What is the C programming equivalent of...
Lisp = Int Integer
| Bool Bool
| Float Float
| List [Lisp]
20
Name:
Anonymous
2010-09-05 7:29
>>19
union , but it doesn't really retain the same well-typedness.
21
Name:
Anonymous
2010-09-05 10:14
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main() {
ostringstream oss;
oss << endl;
string newline = oss.str();
return 0;
}
22
Name:
Anonymous
2010-09-05 11:06
23
Name:
Anonymous
2010-09-05 11:18
24
Name:
Anonymous
2010-09-05 11:47
25
Name:
Anonymous
2010-09-05 12:10
26
Name:
Anonymous
2010-09-05 12:36
>>25
#include <stdio.h>
#include <limits.h>
int main(void) {
int C = INT_MAX;
if (C++ > C)
puts("Sepples. So good, The Sussman uses it.");
else
puts("Back to the imageboards, ``faggot''.");
return 0;
}
27
Name:
Anonymous
2010-09-05 14:14
>>26
How is (C++ > C) evaluated? If it's strictly left to right, it should be false for any value of C. You won't have to rely on integer overflow.
28
Name:
Anonymous
2010-09-05 14:22
>>27
It's undefined behavior.
29
Name:
Anonymous
2010-09-05 14:26
>>27
it is false for any value of C. hence I'm
not ``relying'' on an integer overflow.
30
Name:
Anonymous
2010-09-05 14:33
>>26-29
What about
C++ == --C?
31
Name:
Anonymous
2010-09-05 14:33
>>28
I think in this certain case, the condition will always yield false, although it certainly is UB.
32
Name:
Anonymous
2010-09-05 14:35
33
Name:
Anonymous
2010-09-05 19:06
>>26
Fuck off,
``faggot'' .
34
Name:
Anonymous
2010-09-06 7:41
Sure is ``I just learnt C'' in here.
35
Name:
Anonymous
2010-09-08 4:34
>>26
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int main(void) {
int C = INT_MAX;
puts((C++ > C) ? "Sepples. So good, The Sussman uses it." : "Back to the imageboards, \'\'faggot\'\'.");
return EXIT_SUCCESS;
}
36
Name:
Anonymous
2010-09-08 6:36
>>35
This is not how you write ``
EXPERT QUOTES ''.
37
Name:
Anonymous
2010-09-08 7:09
>>35
Why did you escape those single quotes?
38
Name:
Anonymous
2010-09-08 8:00
>>37
Why did you
ecsape my anus ?
39
Name:
Anonymous
2010-09-08 8:41
>>37
Because I have a Java background.
40
Name:
Anonymous
2010-09-08 9:07
>>39
Please try to overcome your self-imposed handicaps, thank you.
41
Name:
Anonymous
2010-09-08 18:07
>>35
Do you even know who the Sussman is?
43
Name:
Anonymous
2011-02-02 22:34