fire312923253 于 2011-07-12 13:49:02发表:
看得云里雾里的
fffywfn123 于 2011-06-14 16:30:03发表:
我回一个HELLO,WORLD吧
fffywfn123 于 2011-06-14 16:28:59发表:
#include #include #include #include #define LENGTH 100 main() {int fd, len; char str[LENGTH]; fd = open("hello.txt", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); /* 创建并打开文件 */ if (fd) {write(fd, "Hello,world", strlen("Hello, world")); /* 写入Hello, world字符串 */ close(fd);} fd = open("hello.txt", O_RDWR); len = read(fd, str, LENGTH); /* 读取文件内容 */ str[len] = '\0'; printf("%s\n", str); close(fd); }
harvim 于 2011-06-14 16:11:01发表:
初学者到来,看看学学啊
fffywfn123 于 2011-06-14 16:09:02发表:
这又太怎么了吧(6)m:b
hantu 于 2011-06-13 19:09:13发表:
C语言的hello world可以吗?
fffywfn123 于 2011-06-13 16:50:42发表:
高手快快浮现,在线等着的
fffywfn123 于 2011-06-13 16:50:21发表:
给点指引也行
fire312923253 于 2011-07-12 13:49:02发表:
看得云里雾里的
fffywfn123 于 2011-06-14 16:30:03发表:
我回一个HELLO,WORLD吧
fffywfn123 于 2011-06-14 16:28:59发表:
#include
#include
#include
#include
#define LENGTH 100
main()
{int fd, len;
char str[LENGTH];
fd = open("hello.txt", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); /* 创建并打开文件 */
if (fd)
{write(fd, "Hello,world", strlen("Hello, world")); /* 写入Hello, world字符串 */
close(fd);}
fd = open("hello.txt", O_RDWR);
len = read(fd, str, LENGTH); /* 读取文件内容 */
str[len] = '\0';
printf("%s\n", str);
close(fd);
}
harvim 于 2011-06-14 16:11:01发表:
初学者到来,看看学学啊
fffywfn123 于 2011-06-14 16:09:02发表:
这又太怎么了吧(6)m:b
hantu 于 2011-06-13 19:09:13发表:
C语言的hello world可以吗?
fffywfn123 于 2011-06-13 16:50:42发表:
高手快快浮现,在线等着的
fffywfn123 于 2011-06-13 16:50:21发表:
给点指引也行