juandx

在ubuntu安装gcc

编辑 test.c

/* Not stdio.h */
#include <unistd.h>
 
void main()
{
    char str[100];
 
    /*Write on screen*/
    write(1,"\nType Something : ",17);
 
    /*Read at most 100 chars from console into \'str\' */
    read(0,str,100);
 
    write(1,"\nYou typed :\n",13);
 
    /*write 10 chars from \'str\' to screen */
    write(1,str,10);
 
    /*newline*/
    write(1,"\n",1);
}
# gcc -o test test.c

完成后会出现一个可执行文件test,这就是编译好的文件,直接./test 就可以执行了!

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-09-30
  • 2021-08-25
  • 2021-06-11
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2021-11-29
  • 2021-06-12
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案