可讀可執(zhí)行的C語(yǔ)言簡(jiǎn)歷源文件
這里黑客新聞嗎?作者用代碼更新了自己的簡(jiǎn)歷,是不是很接地氣,特符合程序員的逼格。這是一份可讀可執(zhí)行的C語(yǔ)言源文件,也是作者編碼風(fēng)格的體現(xiàn)。
C語(yǔ)言天才寫的一份簡(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)歷
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持我們。
上一篇:全面了解結(jié)構(gòu)體、聯(lián)合體和枚舉類型
欄 目:C語(yǔ)言
下一篇:C++簡(jiǎn)單集合類的實(shí)現(xiàn)方法
本文標(biāo)題:可讀可執(zhí)行的C語(yǔ)言簡(jiǎn)歷源文件
本文地址:http://www.jygsgssxh.com/a1/Cyuyan/2175.html
您可能感興趣的文章
- 01-10C語(yǔ)言實(shí)現(xiàn)修改文本文件中特定行的實(shí)現(xiàn)代碼
- 01-10詳細(xì)解析命令行的getopt_long()函數(shù)
- 01-10VC++實(shí)現(xiàn)程序開機(jī)啟動(dòng)運(yùn)行的方法
- 01-10VC++實(shí)現(xiàn)CStdioFile寫入及讀取文件并自動(dòng)換行的方法
- 01-10VC實(shí)現(xiàn)獲取當(dāng)前正在運(yùn)行的進(jìn)程
- 01-10利用C語(yǔ)言替換文件中某一行的方法
- 01-10C 程序?qū)崿F(xiàn)密碼隱秘輸入的實(shí)例 linux系統(tǒng)可執(zhí)行
- 01-10Visual Studio Code配置C、C++環(huán)境并編寫運(yùn)行的方法
- 01-10C語(yǔ)言如何正確的終止正在運(yùn)行的子線程
- 01-10C語(yǔ)言實(shí)現(xiàn)從文件讀入一個(gè)3*3數(shù)組,并計(jì)算每行的平


閱讀排行
- 1C語(yǔ)言 while語(yǔ)句的用法詳解
- 2java 實(shí)現(xiàn)簡(jiǎn)單圣誕樹的示例代碼(圣誕
- 3利用C語(yǔ)言實(shí)現(xiàn)“百馬百擔(dān)”問題方法
- 4C語(yǔ)言中計(jì)算正弦的相關(guān)函數(shù)總結(jié)
- 5c語(yǔ)言計(jì)算三角形面積代碼
- 6什么是 WSH(腳本宿主)的詳細(xì)解釋
- 7C++ 中隨機(jī)函數(shù)random函數(shù)的使用方法
- 8正則表達(dá)式匹配各種特殊字符
- 9C語(yǔ)言十進(jìn)制轉(zhuǎn)二進(jìn)制代碼實(shí)例
- 10C語(yǔ)言查找數(shù)組里數(shù)字重復(fù)次數(shù)的方法
本欄相關(guān)
- 04-02c語(yǔ)言函數(shù)調(diào)用后清空內(nèi)存 c語(yǔ)言調(diào)用
- 04-02func函數(shù)+在C語(yǔ)言 func函數(shù)在c語(yǔ)言中
- 04-02c語(yǔ)言的正則匹配函數(shù) c語(yǔ)言正則表達(dá)
- 04-02c語(yǔ)言用函數(shù)寫分段 用c語(yǔ)言表示分段
- 04-02c語(yǔ)言中對(duì)數(shù)函數(shù)的表達(dá)式 c語(yǔ)言中對(duì)
- 04-02c語(yǔ)言編寫函數(shù)冒泡排序 c語(yǔ)言冒泡排
- 04-02c語(yǔ)言沒有round函數(shù) round c語(yǔ)言
- 04-02c語(yǔ)言分段函數(shù)怎么求 用c語(yǔ)言求分段
- 04-02C語(yǔ)言中怎么打出三角函數(shù) c語(yǔ)言中怎
- 04-02c語(yǔ)言調(diào)用函數(shù)求fibo C語(yǔ)言調(diào)用函數(shù)求
隨機(jī)閱讀
- 08-05織夢(mèng)dedecms什么時(shí)候用欄目交叉功能?
- 08-05DEDE織夢(mèng)data目錄下的sessions文件夾有什
- 01-10SublimeText編譯C開發(fā)環(huán)境設(shè)置
- 01-11ajax實(shí)現(xiàn)頁(yè)面的局部加載
- 01-10delphi制作wav文件的方法
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 01-10使用C語(yǔ)言求解撲克牌的順子及n個(gè)骰子
- 01-10C#中split用法實(shí)例總結(jié)
- 08-05dedecms(織夢(mèng))副欄目數(shù)量限制代碼修改
- 04-02jquery與jsp,用jquery


