跳转至

Blog

Including C File Over HTTPS

实现了一个有意思的效果,让 C 语言可以从互联网上 #include 头文件。

include_files_from_internet.c
#define STB_SPRINTF_IMPLEMENTATION
#include <https://raw.githubusercontent.com/nothings/stb/master/stb_sprintf.h> // <- look at this 
#include <stdio.h>

int main() {
    char buffer[20];

    // Using functions defined by stb_sprintf.h
    stbsp_sprintf(buffer, "Hello %s", "NAVI");
    puts(buffer);

    return 0;
}

你知道的,4202 年,Everything Over HTTPS(笑