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 Sat 25 Oct 2014, 03:02
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Free cloud compiling at sourceLair.com
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
dennis-slacko531


Joined: 18 Jan 2012
Posts: 103
Location: Oregon

PostPosted: Thu 21 Jun 2012, 01:56    Post_subject:  Free cloud compiling at sourceLair.com
Sub_title: Here's a 'C' snippet to try now.
 

You Gotta try this...
Site is in beta but works in browsers. Android App available too.

http://www.sourceLair.com

This is a SORT example and here's the output:

Before shellsort: 83 86 77 15 93 35 86 92 49 21
After shellsort: 15 21 35 49 77 83 86 86 92 93

Try this or your own code, of course...


#include <stdio.h>

#define MAXARRAY 10

void shellsort(int a[], int total, int index);

int main(void) {
int array[MAXARRAY] = {0};
int i = 0;

/* load some random values into the array */
for(i = 0; i < MAXARRAY; i++)
array[i] = rand() % 100;

/* print the original array */
printf("Before shellsort: ");
for(i = 0; i < MAXARRAY; i++) {
printf(" %d ", array[i]);
}
printf("\n");

shellsort(array, MAXARRAY, 1);

/* print the `shellsorted' array */
printf("After shellsort: ");
for(i = 0; i < MAXARRAY; i++) {
printf(" %d ", array[i]);
}
printf("\n");

return 0;
}

void shellsort(int a[], int total, int index) {
int i = 0;
int j = 0;
int k = 0;
int l = 0;

for(k = 0; k < index; k++) {
for(i = k; i < total; i += index) {
l = a[i];
for(j = (i - index); j >= 0; j -= index) {
if(a[j] > l)
a[j + index] = a[j];
else
break;
}
a[j + index] = l;
}
}

return;
}


Acknowledgement for the code goes to Fahad Uddin --
http://www.mycsnippets.blogspot.com/search/label/sorting
Back to top
View user's profile Send_private_message Visit_website 
Ibidem

Joined: 25 May 2010
Posts: 501
Location: State of Jefferson

PostPosted: Sun 24 Jun 2012, 19:37    Post_subject: Other sites too...  

http://ellcc.org/demo also has an online C compiler, though it just makes an ASM listing.
(ellcc is LLVM/Clang for embedded work)
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
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.0481s ][ Queries: 11 (0.0109s) ][ GZIP on ]