可讀可執(zhí)行的C語言簡(jiǎn)歷源文件
這里黑客新聞嗎?作者用代碼更新了自己的簡(jiǎn)歷,是不是很接地氣,特符合程序員的逼格。這是一份可讀可執(zhí)行的C語言源文件,也是作者編碼風(fēng)格的體現(xiàn)。
C語言天才寫的一份簡(jiǎn)歷
#include <stdio.h>
#include <time.h>
typedef struct {
union {
char * company;
char * school;
char * project;
};
union {
char * location;
char * url;
};
union {
char * title;
char * program;
};
time_t started;
time_t left;
char * description[];
} thing_t;
typedef thing_t job_t;
typedef thing_t school_t;
typedef thing_t project_t;
#define CURRENT 0 /* I wasn't alive at the Unix epoch, so that'll work */ /* Contact Information */ char * name = "Kevin R. Lange";
char * email = "klange@toaruos.org";
char * address = "1045 Mission St, Apt 440n" "San Francisco, CA 94103";
/* Education */
school_t uiuc = {
.school = "University of Illinois at Urbana-Champaign",
.location = "Urbana, IL",
.program = "BS Computer Science",
.started = 1251158400,
.left = 1336608000,
.description = {
"Minor in International Studies in Engineering, Japan",
"Focused on systems software courses",
NULL
}
};
school_t hit = {
.school = "Hiroshima Institute of Technology",
.location = "Hiroshima, Japan",
.program = "Study Abroad",
.started = 1274745600,
.left = 1278288000,
.description = {
"Cultural exchange program",
NULL
}
};
school_t * schools[] = {
&uiuc,
&hit,
NULL
};
/* Projects */
project_t compiz = {
.project = "Compiz Window Manager",
.url = "http://compiz.org",
.title = "Developer",
.started = 1201392000,
.left = 1264291200,
.description = {
"Minor plugin contributor",
"Various research projects",
NULL
}
};
project_t toaruos = {
.project = "ToAruOS",
.url = "https://github.com/klange/toaruos",
.title = "Lead",
.started = 1295049600,
.left = CURRENT,
.description = {
"Hobby x86 Unix-like kernel and userspace",
"Advanced in-house GUI with compositing window manager",
NULL
}
};
project_t * projects[] = {
&toaruos,
&compiz,
NULL
};
/* Employment History */
job_t yelp = {
.company = "Yelp, Inc.",
.location = "San Francisco, CA",
.title = "Software Engineer, i18n",
.started = 1339977600,
.left = CURRENT,
.description = {
"Developed several internal tools and libraries",
"Provided critical input and design work for Yelp's launch in Japan",
NULL
}
};
job_t apple_internship = {
.company = "Apple Inc.",
.location = "Cupertino, CA",
.title = "Software Engineering Intern",
.started = 1306886400,
.left = 1314662400,
.description = {
"Built software framework for testing and verification of desktop retina display modes",
"Assisted other interns with Unix fundamentals",
NULL
}
};
job_t * jobs[] = {
&yelp,
&apple_internship,
NULL
};
void print_thing (thing_t * thing) {
char started[100];
char left[100];
struct tm * ti;
int i = 0;
printf ("%s at %s - %sn", thing->title, thing->company, thing->location);
ti = localtime (&thing->started);
strftime (started, 100, "%B %d, %Y", ti);
if (thing->left == CURRENT) {
printf ("%s to nown", started);
} else {
ti = localtime (&thing->left);
strftime (left, 100, "%B %d, %Y", ti);
printf ("%s to %sn", started, left);
}
char ** desc = thing->description;
while (*desc) {
printf ("- %sn", *desc);
desc++;
}
}
int main (int argc, char ** argv) {
printf ("%sn%sn%snn", name, email, address);
puts ("Educationn");
school_t ** s = schools;
while (*s) {
print_thing (*s);
puts ("");
s++;
}
puts ("Employmentn");
job_t ** j = jobs;
while (*j) {
print_thing (*j);
puts ("");
j++;
}
puts ("Projectsn");
project_t ** p = projects;
while (*p) {
print_thing (*p);
puts ("");
p++;
}
return 0;
}
網(wǎng)友 Wossoneri 編譯后,我們看到的簡(jiǎn)歷

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- C語言 格式化讀寫文件詳解
- C語言 以數(shù)據(jù)塊的形式讀寫文件詳解及實(shí)現(xiàn)代碼
- C語言 以字符串的形式讀寫文件詳解及示例代碼
- C語言 以字符形式讀寫文件詳解及示例代碼
- C語言 文件的打開與關(guān)閉詳解及示例代碼
- 用C語言實(shí)現(xiàn)從文本文件中讀取數(shù)據(jù)后進(jìn)行排序的功能
- C語言以數(shù)據(jù)塊的形式讀寫文件實(shí)例代碼
- C語言壓縮文件和用MD5算法校驗(yàn)文件完整性的實(shí)例教程
- C語言文件操作 fopen, fclose, mkdir詳解
- Windows系統(tǒng)下使用C語言編寫單線程的文件備份程序
- C語言怎么獲得進(jìn)程的PE文件信息
- C語言 文件的隨機(jī)讀寫詳解及示例代碼
相關(guān)文章
C語言用循環(huán)單鏈表實(shí)現(xiàn)約瑟夫環(huán)
這篇文章主要為大家詳細(xì)介紹了C語言用循環(huán)單鏈表實(shí)現(xiàn)約瑟夫環(huán),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10
基于C語言編寫簡(jiǎn)易的英文統(tǒng)計(jì)和加密系統(tǒng)
這篇文章主要介紹如何基于C語言編寫一個(gè)簡(jiǎn)易的英文統(tǒng)計(jì)和加密系統(tǒng),實(shí)際上就是對(duì)字符數(shù)組的基本操作的各種使用,感興趣的可以了解一下2023-05-05
C++基礎(chǔ)入門教程(一):基礎(chǔ)知識(shí)大雜燴
這篇文章主要介紹了C++基礎(chǔ)入門教程(一):基礎(chǔ)知識(shí)大雜燴,本文講解了注釋、頭文件、命名空間等內(nèi)容,需要的朋友可以參考下2014-11-11
C++實(shí)現(xiàn)簡(jiǎn)易的通訊錄管理系統(tǒng)
這篇文章主要為大家詳細(xì)介紹了C++實(shí)現(xiàn)簡(jiǎn)易的通訊錄管理系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-06-06
詳解C語言中的getgrgid()函數(shù)和getgrnam()函數(shù)
這篇文章主要介紹了詳解C語言中的getgrgid()函數(shù)和getgrnam()函數(shù),是C語言入門學(xué)習(xí)中的基礎(chǔ)知識(shí),需要的朋友可以參考下2015-08-08
C語言驅(qū)動(dòng)開發(fā)之內(nèi)核通過PEB獲取進(jìn)程參數(shù)
PEB結(jié)構(gòu)(Process Envirorment Block Structure)其中文名是進(jìn)程環(huán)境塊信息。本文將通過PEB實(shí)現(xiàn)獲取進(jìn)程參數(shù),感興趣的小伙伴可以了解一下2022-10-10

