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

Fucking C

Name: Anonymous 2012-11-03 14:43

Why it doesn't show me strings like "  a"?
Why is the while loop in the trim function bugged (if I input 2 chars the next input length can't be less than 2)?

#include <stdio.h>

#define MAX 1001

int getLine(char s[], int length){ // returns 1 or 0

    int i, qttWord = 0; //qttWord = counter of letters for s[]
    int c; // c = getchar()

    /*Reads the input and puts it into s[], then, verifies if the input is just \n,
    * if so, returns 0(i), if not, puts '\0' at the end of the string.
    */
    for (i = 0; i < length-1 && (c = getchar()) != EOF && c != '\n'; ++i){
            s[i] = c;
            ++qttWord;

    }
    if (i == 0){
        return 0;
    } else if (c == '\n'){
        ++i;
        s[i] = '\0';

    }
    /*Verifies if the string is just ' ' or '\t'
    * if so, returns 0
    */
    char flag = '\0';
    for (i = 0; i < qttWord && flag != '1'; ++i){
        if (s[i] == ' ' || s[i] == '\t'){
            flag = '0';
        } else{
            flag = '1';
        }
    }
    if (flag == '0')
        return 0;

    return qttWord;
}
void trim(char s[], int length){

    char s2[MAX];
    int i, qttWord = 0;

    /*while (s[length] != '\0'){
        ++length;
    }
    printf("length:%d\n", length);*/
    for (i = 0; i < length; ++i){
        if (i < length-1){
            if (s[i] == ' ' && s[i+1] != ' '){
                s2[i] = s[i];
                ++qttWord;
                printf("1:%d\n", s2[i]);// if true prints "1" and the character(' ')
            }
        }
        if (s[i] != ' '){
            s2[i] = s[i];
            ++qttWord;
            printf("0:%d\n", s2[i]);//if true prints "0" and the character
        }
    }
    s[0] = '\0';
    s2[qttWord] = '\0';

    for (i = 0; i < qttWord; ++i){
        s[i] = s2[i];
    }
    s2[0] = '\0';
}

int main(){
    char line[MAX];
    int lgh = 0;

    while ((lgh = getLine(line, MAX)) != 0){
        trim(line, lgh);
        printf("%s\n", line);
        line[0] = '\0';
        lgh = 0;
    }
    return 0;
}

Name: Anonymous 2012-11-05 9:14

>>120
13-years old
Fuck off and die, cretin.

by telling them on their use of slurs.
Fuck off, nigger faggot cretin.

Name: Anonymous 2012-11-05 9:20

>>120
ONCE AGAIN< FUCK OFF AND DIE YOU FREEDOM HATING PIECE OF SHIT

Second of all, this all started when you borked out the retarded statement that any pejorative usage of the word faggot is evil and harmful to society in any possible context, which is fucking false.  If you plug your ears and go LALALA when presented with a corner case, then you are not cut out to be a programmer.

Name: Anonymous 2012-11-05 9:41

>>122
Look, buddy, you ``ironic'' use of the word I can bet that ain't, because in the end, what makes it funny and edgy is that poking at the insecurities of your friends with the outrageous notion that they are gay is what they most likely find humorous. The fact that you use it pejoratively is damning in its own way, besides, and an argument on itself, closet homophobe

I know this because that's been the case with all of my good ol' pals which do that. And the hundreds of grown-up versions of you on the Internet.

And now you are using it in an attempt to rail me off. So much for your ``feminism''.

I haven't responded to you on that because the threads have either threadstopped or I have stated that I'm bailing out because I don't have that much time to deal with self-deluded little assholes like you.

And you still don't understand what free speech entails.

Fuck off, and come back when you are further into puberty, ``please''.

Name: >>123 2012-11-05 9:44

>>122
And this ``started'' because you can't quit an argument on the Internet, so what else can we do but milk you for all your nerdrage?

Name: Anonymous 2012-11-05 9:47

>>123
Fuck off and die freedom hating faggot nigger. My rights are the most sacred thing on earth and I will kill you with my gun to defend them.

Name: >>123 2012-11-05 9:49

Look, buddy, you ``ironic'' use of the word I can bet that ain't,

Shit, I really fucked up that sentence. Oh, well. Back to work it is.

Name: Anonymous 2012-11-05 9:54

>>126
Back to work
You will never curtail my rights. Die in a fire cretin.

Name: Anonymous 2012-11-05 10:14

>>124
EAT SHIT AND DIE CRETIN.

>>123
The fact that you use it pejoratively is damning in its own way, besides, and an argument on itself, closet homophobe.
Conclusion does not follow from premises.  Prove to me that such behaviour actually hurts homosexuals.

And the hundreds of grown-up versions of you on the Internet.
FUCK OFF AND DIE.

And you still don't understand what free speech entails.
It entails that anyone may be criticized by anyone else, and that anyone may say discriminatory jokes to their heart's content.

Fuck off, and come back when you are further into puberty, ``please''.
FUCK OFF AND DIE YOU COCK SUCKING CRETIN I FUCKING HATE YOU.

Name: Anonymous 2012-11-05 10:56

>>128
And we are criticising you for being a crappy kid due to making homophobic jokes.

It's harmful in public and semi-public settings, like these. Sure, segregated from society it's arguably harmless. That you still think that it's an insult tells me that you are a hypocrite.

And you should really get off your computer now, son. Why must you suffer so much anger over being corrected on a forum.

I'm out for a while, I've got stuff to do.

Name: Feminazi Stormtrooper 2012-11-05 11:13

>>129
Correction: it's not that you think that it's an insult (it is), it's that you use it as such.

Name: Anonymous 2012-11-05 12:02

>>83-130
You CRETINNSE have only spent fifty posts arguing over nothing. I suggest you STEP UP YOU'RE GAME before someone suspects it was all a ruse!

Name: Anonymous 2012-11-05 12:07

This thread is great, cretins! Keep it up!

Name: Anonymous 2012-11-05 12:21

>>132
Yeah, who knows how many Libertardian impostors are now running amok. It's just too fun.

Name: Anonymous 2012-11-05 13:02

>>129
And we are criticising you for being a crappy kid due to making homophobic jokes.
I'm not a child you piece of shit.

It's harmful in public and semi-public settings, like these.
Agreed.

Sure, segregated from society it's arguably harmless.
Finally, that's all I wanted to hear.

it's not that you think that it's an insult (it is), it's that you use it as such.
It's an interesting situation; I find the word homosexual neutral or even positive, yet I see faggot as an insult.  Regardless, it is merely your opinion that I am a closet homophobe, and the fact that I have an odd or unusual definition for a word does not make me one.

Why must you suffer so much anger over being corrected on a forum.
Because fuck you that's why.

Name: Comrade Feminazi 2012-11-05 13:09

>>134
Check your privilege.

Name: Anonymous 2012-11-05 13:12

>>135
While I realize that my life is less shitty than that of many people, I fail to see the relevance to this discussion.

Name: Praetor Feminazi 2012-11-05 13:14

>>136
That you think your personal meaning of ``faggot'' has nary a relevance given the background of the word.

Name: Anonymous 2012-11-05 13:15

>>136
Imbecile.

Name: Anonymous 2012-11-05 13:21

>>135
Words aren't magical.  If you teach a large group of children that ``nigger'' is a synonym for ``happy'', nothing out of the ordinary will happen until they interact with someone who doesn't share their meaning.  I don't see how the dominant meaning of the word in society has any relevance over my usage of it with other people who share the same definition as me.

Name: Anonymous 2012-11-05 13:21

>>138
Likewise, cretin.

Name: Anonymous 2012-11-05 13:24

>>139
You inherited the word with its connotations and use like it's nothing because it's of no consequence to you.

Also, enough /prog/ for me today.

Name: Anonymous 2012-11-05 14:44

>>139
Niggers are happy, because they have low IQ and unable to comprehend their slavery. Had niggers been unhappy, they would have already butchered your filthy U.S. and created their own state on American soil, because only blood can wash your crimes before niggers.

Name: Anonymous 2012-11-05 15:07

>>142
terrorist detected

Name: Anonymous 2012-11-05 16:00

>>142
How am I responsible for what my ancestors the ancestors of the people I kind of look like by virtue of being caucasian did two hundred years ago?  fucking illogical piece of shit

Name: Anonymous 2012-11-05 16:25

>>144
Check your privilege, chalkie.

Name: Anonymous 2012-11-05 16:30

>>89
a life without infinite ordinals is not worth living

Name: Anonymous 2012-11-05 16:35

trim=:#~(+./\.*.+./\)@(' '&~:)

Name: Anonymous 2012-11-05 19:08

>>147
My heart skap a beat when I realized J was being.

Name: Anonymous 2012-11-05 20:02

>>148
skap
wot

Name: Anonymous 2012-11-05 20:12

>>148
skap

Name: Anonymous 2012-11-05 20:37

>>149
Don't try to curtail my freedom of speech, cretin.

FUCK YOU AND DIE IN A FIRE I HATE YOU.

Name: Anonymous 2012-11-05 20:38

>>151
colm dann fiminazee

shk jur prevlge fee wit man

Name: Anonymous 2012-11-05 21:07

Why is this thread still here? Did one of you actually help him?

>>39
Holy shit. That is what the CPython maintainers actually wrote.

Name: Anonymous 2012-11-05 21:29

>>155
fucking dubs

Name: Anonymous 2012-11-05 21:31

>>154-155
break;

Name: Anonymous 2012-11-05 23:06

>>153
He's beyond our help, >>153-san.
I was talking to >>153-san.

Name: Anonymous 2012-11-06 1:49

>>145
Fuck off and die, racist cretin.

Name: Anonymous 2012-11-06 1:53

>>94

define "equivalence classes"
You didn't even read it! I'm not going to finish it now!

define "all"
define "Cauchy"
I was getting there.

define "sequences"
The set of all natural numbers is denoted N. If X is a set, X is an element of N if and only if X is a natural number.

A sequence of rational numbers if a function defined from the set of natural numbers to the set of rational numbers.

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