Compiling C With Linux
Page 1 of 1
Compiling C With Linux
Compiling C With Linux
Use Geedit and create a file called hello.c
You can even put the compile line into a bash script
Use Geedit and create a file called hello.c
- Code:
#include <stdio.h>
main() {
printf("Hello World
\
n");
}
- Code:
gcc -o hello hello.c
execute file
./hello
Test file
file hello
strings hello|grep -i -A 10 hello
cat hello
strings hello|grep -i -A 10 world
strings f|grep -i -A 10 hello
You can even put the compile line into a bash script
- Code:
#!/bin/bash
gcc -o hello hello.c
Re: Compiling C With Linux
Creating a function in .bashrc to make this so much easier and faster!
- Code:
# put this in your .bashrc file
# Usage compile file.c
#
function compile() {
myvar="$@"
gcc -o file.exe "$myvar"
sudo chmod +x file.exe
echo "All Done!"
}
Similar topics
» How To Use Linux Mint Extensions in any linux distro
» Find your linux repo lists on Linux
» how to setup samba for linux config and allowing linux shares and adding users to samba commands
» use inkscape for linux for a good graphic editor for linux
» KDE 5 for Linux Mint 17 and other linux distros like open suse
» Find your linux repo lists on Linux
» how to setup samba for linux config and allowing linux shares and adding users to samba commands
» use inkscape for linux for a good graphic editor for linux
» KDE 5 for Linux Mint 17 and other linux distros like open suse
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|