- Joined
- Jun 23, 2026
- Messages
- 856
- Online time
- 3d 3h
- Reputation
- 2,718
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
include <stdio.h>
int main(void){
int x, y;
}
C:include <stdio.h> int main(void){ int x, int y; }
void inplace_swap(int *x, int *y){
}
int main(void){
int x;
int y; //fixed var declare syntax
}
C:void inplace_swap(int *x, int *y){ } int main(void){ int x; int y; //fixed var declare syntax }
void inplace_swap(int *x, int *y){}
int main(void){
int x;
int y; //fixed var declare syntax
x = 5;
y = 7;
}
Jfl I forgot the int x, y; syntax
void inplace_swap(int *x, int *y){
*x ^= *y;
*y ^= *x;
*x ^= *y;
}
int main(void){
int x;
int y;
x = 5;
y = 7;
}
.C: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("%d %d", x , y); inplace_swap(&x , & y); printf("%d %d", x , y); }
Tough
#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> 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); }
yuppersfor sane fmt?
#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);
}
why the extra byte? Or am i trippinC:#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
I counted wrongwhy the extra byte? Or am i trippin
neat though
would be too complicated for one file icltoo lazy but I was gonna convert get rid of stdio entirely and use unistd.h
I'll do asm syscalls tomorrowwould be too complicated for one file icl
for when you need your own library:I'll do asm syscalls tomorrow