davidktw
Arch-Supremacy Member
- Joined
- Apr 15, 2010
- Messages
- 13,547
- Reaction score
- 1,301
global_variables.h ?So what should😈.hcontains to compile theCcode below ?
C:$ cat 🤡.c #include "😈.h" ℤ 𝑓(ℤ 𝑥, 𝛼** 𝑦) { 🗣("🎉 %s\n", 𝑦[1]); 💋 0; } $ gcc -o 🤡 🤡.c $ ./🤡 👩👩👧👧 🎉 👩👩👧👧
@theMKR surely know what to do right ?
No global variables required.
wink wink
![]()
anyway i really duno.
stdint
i dun code in emojiThought you have been citing all these while you know C?![]()
i dun code in emoji
how come it prints out icecream ppl.
why not ice cream ppl ppl ?
$ cat 测试.c
#include "中文.h"
整数 主要(整数 论据数, 字** 论据) {
打印(字串"说:世界,您好。"回车, 论据[一]);
回 零;
}
$ gcc -o 测试 测试.c
$ ./测试 某某
某某说:世界,您好。
So what should😈.hcontains to compile theCcode below ?
C:$ cat 🤡.c #include "😈.h" ℤ 𝑓(ℤ 𝑥, 𝛼** 𝑦) { 🗣("🎉 %s\n", 𝑦[1]); 💋 0; } $ gcc -o 🤡 🤡.c $ ./🤡 👩👩👧👧 🎉 👩👩👧👧
@theMKR surely know what to do right ?
No global variables required.
wink wink
![]()
$ cat mychar.c
#include <stdio.h>
int main (int argc, char** argv) {
printf("The second character displays is %s\n", 𝑦[1]);
return 0;
}
$ gcc -o mychar mychar.c
$ ./mychar Today is a sunny day
The second character displays is o
seems to be stdio.h
ℤ seems to be int
𝑓 should be main
a should be of type char
🗣 seems to be printf
should be some kind of message
should be return
should be just any valid filename
should be some characters input
y is a char pointer
so it could be re-written as
C:$ cat mychar.c #include <stdio.h> int main (int argc, char** argv) { printf("The second character displays is %s\n", 𝑦[1]); return 0; } $ gcc -o mychar mychar.c $ ./mychar Today is a sunny day The second character displays is o
just guessing ... haha ...
This is not a guessing game. I didn’t replace anything manually like you. My code will compile properly if the proper header file is provided.
So what should the header file contains?
I am actually surprised this can actually be a challenge. I was thinking when I posted it that someone whom knows C will find this trivial.
![]()
I thought in the posts above, I have already shown you how I compile and executed them using GCC ?bro davidktw, wow you mean you can compile these codes with these icons? didn't know it can be done ...
still, the header file should be stdio.h to me ... maybe you want to reveal it ...![]()
$ cat 😈.h
#include <stdio.h>
#define 𝑓 main
#define 🗣 printf
#define 💋 return
typedef int ℤ;
typedef char 𝛼;
$ cat 中文.h
#include <stdio.h>
#define 主要 main
#define 打印 printf
#define 回 return
#define 回车 "\n"
#define 字串 "%s"
#define 零 0
#define 一 1
typedef int 整数;
typedef char 字;
I thought in the posts above, I have already shown you how I compile and executed them using GCC ?
C:$ cat 😈.h #include <stdio.h> #define 𝑓 main #define 🗣 printf #define 💋 return typedef int ℤ; typedef char 𝛼;
C:$ cat 中文.h #include <stdio.h> #define 主要 main #define 打印 printf #define 回 return #define 回车 "\n" #define 字串 "%s" #define 零 0 #define 一 1 typedef int 整数; typedef char 字;
![]()
bro davidktw, ok I see it ... thanks for sharing ...![]()
Trivial isn’t it?![]()
haha ... just like magic, once you learn the trick behind, it's easier to understand ...![]()
C doesn’t just come with the compiler. There is always the C preprocessor before it. Otherwise your #include wouldn’t even work.
There is indeed a lot of magic that can be played before the C parsing starts. Feel free to read up the latest standards of C and see what the preprocessor can do.
![]()
like to see more "magic" to be shared with us ... haha ...![]()