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 16 Apr 2014, 05:57
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 [5 Posts]  
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 poster's 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

Last edited by Lobster on Sat 04 Jun 2005, 15:11; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's 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 poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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