Join 75,000+ Looksmaxxing Members!

Register a FREE account today to become a member. Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox.

  • DISCLAIMER: DO NOT ATTEMPT TREATMENT WITHOUT LICENCED MEDICAL CONSULTATION AND SUPERVISION

    This is a public discussion forum. The owners, staff, and users of this website ARE NOT engaged in rendering professional services to the individual reader. DO NOT use the content of this website as an alternative to personal examination and advice from licenced healthcare providers. DO NOT begin, delay, or discontinue treatments and/or exercises without licenced medical supervision. Learn more

Mog Battle ITT continue the code ( C )

Register to hide this ad
C:
void inplace_swap(int *x, int *y){
    
}

int main(void){
    int x;
    int y; //fixed var declare syntax
}

Jfl I forgot the int x, y; syntax
C:
void inplace_swap(int *x, int *y){}

int main(void){
    int x;
    int y; //fixed var declare syntax
    x = 5;
    y = 7;
}
 
Last edited:
2026-06-26_00-37-39.webp


Compiled with

Bash:
gcc -std=c17 -Wall -Wextra -Werror -O2 main.c -o fun
 
C:
#include <stdio.h>

void inplace_swap(int *x, int *y){

    *x ^= *y;
    *y ^= *x;
    *x ^= *y;

}

int main(void){
    
    int x;
    int y;
      
    x = 5;
    y = 7;

    printf("\tx = %d y = %d\n", x , y);
    inplace_swap(&x , & y);
    printf("\tx = %d y = %d\n", x , y);

}
 
C:
#include <stdio.h>

void inplace_swap(int *x, int *y){

    *x ^= *y;
    *y ^= *x;
    *x ^= *y;

}

int main(void){
    
    int x;
    int y;
      
    x = 5;
    y = 7;

    printf("\tx = %d y = %d\n", x , y);
    inplace_swap(&x , & y);
    printf("\tx = %d y = %d\n", x , y);

}
for sane fmt?
 
C:
#include <stdio.h>
#include <unistd.h>

void inplace_swap(int *x, int *y){

        *x ^= *y;
        *y ^= *x;
        *x ^= *y;

}

int main(void){
   
        int x = 0;
        int y = 1;
     
    printf("\tx = %d y = %d\n", x , y);
    inplace_swap(&x , & y);
    printf("\tx = %d y = %d\n", x , y);

    write(1, "\n\tHello World\n", 15);

}

@WhitepiII
 
C:
#include <stdio.h>
#include <unistd.h>

void inplace_swap(int *x, int *y){

        *x ^= *y;
        *y ^= *x;
        *x ^= *y;

}

int main(void){
   
        int x = 0;
        int y = 1;
     
    printf("\tx = %d y = %d\n", x , y);
    inplace_swap(&x , & y);
    printf("\tx = %d y = %d\n", x , y);

    write(1, "\n\tHello World\n", 15);

}

@WhitepiII
why the extra byte? Or am i trippin
neat though
 
too lazy but I was gonna convert get rid of stdio entirely and use unistd.h
 

Users who are viewing this thread

Back
Top