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

What is the C programming equivalent of...

Name: Anonymous 2010-09-04 13:34

String newline = System.getProperty("line.separator");

Name: Anonymous 2010-09-04 13:42

1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘newline’

Name: Anonymous 2010-09-04 13:47

'\n'

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.

Name: Anonymous 2010-09-04 15:05

(native-eol-style

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.

Name: Anonymous 2010-09-04 15:59

What is the C programming equivalent of...
System.gc();

Name: Anonymous 2010-09-04 16:31

>>7
gc my anus

Name: Anonymous 2010-09-04 17:32

>>7
free()

Name: Anonymous 2010-09-04 19:17

>>7
(collect)

Name: Anonymous 2010-09-04 19:26

What is the C programming equivalent of...
System.currentTimeMillis();

Name: Anonymous 2010-09-04 19:52

>>11
time(NULL)*1000;

Name: Anonymous 2010-09-04 19:57

What is the C programming equivalent of...
fibo :: Int -> Maybe Integer
fibo n = undefined
?

Name: Anonymous 2010-09-04 21:08

What is the C programming equivalent of...
*
"GRUNNUR"

;

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);
}

Name: Anonymous 2010-09-04 21:31

>>14
}

Name: Anonymous 2010-09-04 21:41

>>14
-lc

Name: Anonymous 2010-09-05 0:23

>>7

(void)0;

Name: Anonymous 2010-09-05 4:55

What is the C programming equivalent of...

Lisp = Int Integer
     | Bool Bool
     | Float Float
     | List [Lisp]

Name: Anonymous 2010-09-05 7:29

>>19
union, but it doesn't really retain the same well-typedness.

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;
}

Name: Anonymous 2010-09-05 11:06

>>21
C != C++

Name: Anonymous 2010-09-05 11:18

>>22
0

Name: Anonymous 2010-09-05 11:47

>>23
You mean

c++, 0

Name: Anonymous 2010-09-05 12:10

>>22
C++ > C

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;
}

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.

Name: Anonymous 2010-09-05 14:22

>>27
It's undefined behavior.

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.

Name: Anonymous 2010-09-05 14:33

>>26-29
What about C++ == --C?

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.

Name: Anonymous 2010-09-05 14:35

>>30
see
>>31

Name: Anonymous 2010-09-05 19:06

>>26
Fuck off, ``faggot''.

Name: Anonymous 2010-09-06 7:41

Sure is ``I just learnt C'' in here.

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;
}

Name: Anonymous 2010-09-08 6:36

>>35
This is not how you write ``EXPERT QUOTES''.

Name: Anonymous 2010-09-08 7:09

>>35
Why did you escape those single quotes?

Name: Anonymous 2010-09-08 8:00

>>37
Why did you ecsape my anus?

Name: Anonymous 2010-09-08 8:41

>>37
Because I have a Java background.

Name: Anonymous 2010-09-08 9:07

>>39
Please try to overcome your self-imposed handicaps, thank you.

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