gregor001 wrote 1 year ago reply Hi ya all:)
short: How to write simplest "HELLO" program in Slax?
i read that it has already included gcc compiler.
can please someone write whgole steps, please (with prorgam)?
i guess it goes something like that:
1)write a program in word processor:
cout forum wrote 1 year ago reply Open up a console window.
type vi hello.c and use the vi editor to create the file.
Then use gcc to compile the file, and run the resulting a.out file.
Here is the file, and the steps to compile and run:
root@slax:~# cat hello.c
/* Hello World program */
root@slax:~# gcc hello.c
Desktop/ a.out* hello.c
forum wrote 1 year ago reply Oops, the web interface messed up the #include line. Should be:
#include\ forum wrote 1 year ago reply Dammit. The line should be #include stdio.h, with stdio.h enclosed in angle brackets. vonbiber wrote 1 year ago reply Write the program (from a console):
cat > main.c <<EOF
gcc main.c -o hello
agreimann wrote 1 year ago reply Yes. I was about to say what vonbiber was going to say. :) That'd be what I'd recommend doing. You could use echo as well here, instead of cat:
root@slax# echo "\
*/ Display the greeting here /*
*/ Quit /*
}" > ccode.c
root@slax# gcc ccode.c -o cprogram
I might add that bash is an undervalued but fully Turing-compliant language that can also make programs (especially when combined with Perl, for instance). In this case, however, this is just a little script, but it can get the simple job done as well:
root@slax# echo "\
# Display the greeting here
echo "Hello, world."
exit 0" > bashapp
root@slax# chmod +x bashapp && ./bashapp
Anyway, good luck... :) openxcellaus wrote 1 year ago reply Nice example are given by you and I have just tried these examples. Really good and let's me try other programming.
http://www.openxcell.com.au/website-development-australia nickkkkk wrote 1 year ago reply Use python, it easy:
print "HELLO" python-commenter wrote 1 year ago reply I believe for the latest python it is:
print ("HELLO") admiral.adney wrote 319 days ago reply yup you are write its
print ("HELLO") agreimann wrote 319 days ago reply Guys, why cap HELLO here? In Python 2/3.x, it can be just like this: print("Hello") firstname.lastname@example.org wrote 207 days ago reply its a test reply.