如果.c文件在文件夹中,如何在Ubuntu中编译C程序?

问题描述 投票:-2回答:2

如果.c文件在文件夹中,我不知道如何在Ubuntu中编译C程序。

当文件在桌面上时,我打开终端,我写dir,然后cd Desktop,然后gcc hello.c -o hello,然后./hello。如果程序在桌面上的文件夹中,我该怎么办?

c ubuntu
2个回答
1
投票

如同.c在桌面中,但导航到cd folder文件夹一样


0
投票
cd Desktop
cd folder_name

这很简单。

© www.soinside.com 2019 - 2024. All rights reserved.