Original error:
root@vishal-HP-Notebook:/home/vishal# sudo apt-get install gcc Reading package lists... Done Building dependency tree
Reading state information... Done gcc is already the newest version (4:7.3.0-3ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 179 not upgraded. root@vishal-HP-Notebook:/home/vishal# gcc gcc: fatal error: no input files compilation terminated.
root@vishal-HP-Notebook:/home/vishal# sudo apt-get install gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version (4:7.3.0-3ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 179 not upgraded.
root@vishal-HP-Notebook:/home/vishal# gcc
gcc: fatal error: no input files
compilation terminated.
Following Niclas Börlin's answer:
vishal@vishal-HP-Notebook:~$ cat v.c
#include<stdio.h>
void main()
{
printf("Mudit");
}
vishal@vishal-HP-Notebook:~$ gcc v.c
vishal@vishal-HP-Notebook:~$ a.out
a.out: command not found
vishal@vishal-HP-Notebook:~$ gcc --version
gcc (Ubuntu 4.8.5-4ubuntu8) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
vishal@vishal-HP-Notebook:~$
HOW DO I USE IT FOR CODE BLOCKS IDE I've got a method to run on terminal
vishal@vishal-HP-Notebook:~$ cat v.c
#include<stdio.h>
void main()
{
printf("Mudit");
}
vishal@vishal-HP-Notebook:~$ gcc v.c
vishal@vishal-HP-Notebook:~$ ./a.out
Muditvishal@vishal-HP-Notebook:~$
./a.out
instead ofa.out
.ls -l a.out
andecho $PATH
.