回文章列表
作者jeremy007.bbs@ptt.cc (linux藍海帝國) 看板: linux
標題請問一個奇怪的程式碼...
時間批踢踢實業 (2008/03/02 Sun 02:00:54)
以下這段程式碼在 FreeBSD 6.2-RELEASE-p11 系統上執行可以印出 "?????"
但在 linux fedora8 上面執行,卻沒有任何訊息印出
linux fc8 OS 做了什麼機制,導致沒有印出訊息呢 ?
謝謝!
//--------------------------------------
#include<stdio.h>
#include<stdlib.h>

int foo() {
        printf("?????\n");
        exit(0);
}

int main(void) {
        long q[1];
        q[2] = (long)foo;
        return 0;
}
//--------------------------------------

--
※ 發信站: 批踢踢實業坊(ptt.cc) 
◆ From: 61.216.198.75
asimon:是gcc版本問題吧 ?!                                       03/02 02:00
文章選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻