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 22 Oct 2014, 18:34
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 [2 Posts]  
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
Subject description: 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 poster's 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 from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0423s ][ Queries: 11 (0.0052s) ][ GZIP on ]