當前位置:編程學習大全網 - 網站源碼 - 基於Linux的c語言程序設計

基於Linux的c語言程序設計

#包含?& ltunistd.h & gt

#包含?& ltsys/types . h & gt;

#包含?& ltsys/stat . h & gt;

#包含?& ltfcntl.h & gt

#包含?& ltstdio.h & gt

#包含?& ltstring.h & gt

(同Internationalorganizations)國際組織

主()

{

int?FD;

夏爾?*?p?=?“妳好”;

夏爾?buf[256]?=?{0};

如果?(-1?!=?(fd?=?打開(“。/new.txt ",O_RDWR)))

{

如果?(-1?!=?寫(fd,?p,?strlen(p))

{

printf("寫?OK \ n”);

}

其他

printf("寫?失敗\ n ");

關閉(FD);

}

如果?(-1?!=?(fd?=?打開(“。/new.txt ",O_RDONLY)))

{

如果?(-1?!=?閱讀(fd,?buf,?256))

printf("閱讀:?%s\n ",buf);

關閉(FD);

}

回歸?0;

}

  • 上一篇:投訴合肥公交通卡,押金退還完全是忽悠辦卡人的!20元押金,應該叫辦卡20元工本費才對!
  • 下一篇:163k家居裝修門戶網站系統好嗎
  • copyright 2024編程學習大全網