compiling C program with clang

--

>>

#apt update -y && apt upgrade -y && apt install clang -y && apt install vim -y
#vi file.c

#include <stdio.h>

int main() {
int a = 10;
int b;
int sum = a + b;
float c = (float)a;

printf("Sum of %d and %d is %d\n", a, b, sum);

return 0;
}

[ dasar ]
#clang file.c -o file
[ pakai standard ]
#clang -std=c18 file.c -o file
[ pakai warnings ⚠️ ]
#clang -std=c18 -Wall file.c -o file
[ Dan Masih Banyak Variasi Lain ]
.........
.........
.........

[ run program ]

#./file

--

--

No responses yet