Starting C in Ubuntu
First we have to set up c environment in ubuntu
gcc and other neccessary compilers are not pre-installed in Ubuntu.
Execute this
Code:
sudo apt-get update sudo apt-get install build-essential
In case your machine doesn’t have internet access, execute this first :
Code:
sudo apt-cdrom add
After setting up environment now time to coding. Simply we can create any file as like as test.c. We can open this file in VI editor. And writing some c code like as
#include
int main()
{
printf("It's me\n");
return 0;
}
Then save and quit from VI editor. Execute following command to compile and run the test.c file
To compile
gcc test.c
And run
./a.out
That’s it.
- Posted in: C
Thanks Alot 100%
You are welcome.