|
|
[php]
/* Filename:test.c */
#!/usr/bin/tcc -run
#include <stdio.h>
#include <unistd.h>
int main()
{
while (1)
{
printf("Hello?\n");
sleep(1);
}
}
[/php]
这个是一个谁都知道的code。
>和>>的用法大家也都明白
- ls -l /usr/bin/ > dir-list.log
复制代码
可是为什么上面的程序
- ./test.c > test.log
- test.log文件产生了,但里面的确是空的呢?
复制代码
后来发现把sleep()注释掉,
test.log就有大量的Hello?行了。
这是为什么呢?
用python写的程序有同样的问题。 |
|