Categories
General

我承認這很蠢

為了這”1.8″折騰一下午。-_-”

$ gcc -I /usr/lib/ruby/1.8/i486-linux/ -o sum sum.c -lruby1.8
$ ./sum
Sum to 5 is 15
Sum to 10 is 55
Sum to 15 is 120
Sum to -1 doesn’t compute!
Sum to 20 is 210

記下來,之後有要在 C 內嵌 ruby 時不要再卡在這種白爛小處了。

CC BY-SA 4.0 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.