I try the two ways as follows. Both the first and the second are ok. But the thrid one could not work.
1. Run the script in the command line:
$ echo main(){puts("Hello World");} | tcc -run -
<stdin>:1: warning: implicit declaration of function puts
Hello World
2. Build hello.c and run with the command
1). Build hello.c
#!/usr/bin/tcc -run
#include <stdio.h>
int main()
{
printf("Hello World
");
}
2).call the application:
$ cd ./Documents/cfiles
$ tcc -run hello.c
Hello World
3. Run the lines one by one
I want to run codes one by one just like any Python script (>>>) on the Ubuntu Terminal, but it could not work.
$ tcc -run -
#include <stdio.h>
int main()
{
printf("Hello, World!
");
return 0;
}
main()