Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 26 Nov 2014, 13:24
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Setting up tinycc C compiler
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Thu 02 Jun 2005, 07:17    Post_subject:  Setting up tinycc C compiler  

This page (C gurus please check and add to)

http://www.goosee.com/puppy/wikka/TinyCc

will get you started in the interpreted mode of tinycc
which Barry has adopted (Adopt-a-Puppy)

I was trying to work out how to do a random function
but never did . . .
still it is a start . . .

"Hello World"
Back to top
View user's profile Send_private_message Visit_website 
menno
Guest


PostPosted: Fri 03 Jun 2005, 05:16    Post_subject: random  

Code:
int main() {
int i;
/* init random generator by current time */
srand(time(0));
/* so now display ten random numbers */
for (i=0;i<10;i++){
    printf("%d is %g\n",i,rand());
    }
return 0;
}

Save this as randtest.c .

execute by tcc -run randtest.c
or
compile it as tcc -o randtcc randtest.c
and run it by ./randtcc

Every time you run it you get a other sequence of ten numbers .
Back to top
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sat 04 Jun 2005, 01:14    Post_subject: Random Sea  

Thanks Menno Smile

that will do nicely . . .

the numbers seem to be in
what I believe are referred to as floating point
Tried to find a mod or modulus function
- in fact tried to find a C tutorial and I must 'av
been looking in the wrong caves - coz I found nothing
entiled "C for cructaceans and dumb aquatics"

tinycc - a c compiler and interpreter is too kewl

. . . now it takes two years to learn to program in C
(according to all the best mermaid tales)
If my psychiatrist approves and I can afford the
performance enhancing drugs and mineral supplements
I may go for it.

NB. Only Puppy can do this . . .

Who else is coming? (so to speak)

Cool

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
menno
Guest


PostPosted: Sat 04 Jun 2005, 13:09    Post_subject: c tutorials  

http://computer.howstuffworks.com/c1.htm
http://www.cs.cf.ac.uk/Dave/C/CE.html
www.physics.drexel.edu/courses/Comp_Phys/General/C_basics
www.acm.uiuc.edu/webmonkeys/book/c_guide

I hope this is what you looking for .
Back to top
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sat 04 Jun 2005, 15:16    Post_subject: Just right  

Thanks Menno

That will do nicely . . .
I will put the link in tuxcards (part of puppy)
which is ideal for snippets of code
- bits of C weed

Smile
Appreciate it - many thanks
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0466s ][ Queries: 11 (0.0051s) ][ GZIP on ]