2011年5月25日
摘要: 源自《The C Programming Language》 P53 pr3-4,代码位于ex3.6中: 在数的对二的补码表示中,我们编写的itoa函数不能处理最大的负数,即n等于-(2^(字长-1))的情况。请解释原因, 修改函数使得它在任意机器上运行时都能得到正确结果。 代码:main.c 1 #include <stdio.h> 2 #include <string.h> 3 4 #define MAXLINE 100 5 6 void itoa(int n, char s[],int width); 7 void itob(int n, char s[], in 阅读全文
posted @ 2011-05-25 23:52 将军之盾 阅读(403) 评论(0) 推荐(0) 编辑