I added some documentation to the function program, and I created a documentation...
author[email protected] <[email protected]>
Mon, 10 May 2010 16:35:02 +0000 (10 16:35 +0000)
committer[email protected] <[email protected]>
Mon, 10 May 2010 16:35:02 +0000 (10 16:35 +0000)
src/arrays/arrays-clean.c [new file with mode: 0644]
src/functions/function
src/functions/function.c

diff --git a/src/arrays/arrays-clean.c b/src/arrays/arrays-clean.c
new file mode 100644 (file)
index 0000000..c61e79e
--- /dev/null
@@ -0,0 +1,13 @@
+#include <stdio.h>
+int main(){
+int array[10], i;
+i = 1;
+while (i <= 10){
+       array[i] = i;
+       ++i;
+}
+for (i=1;i <= 10;++i)
+       printf("array[%d] equals %d\n", i, array[i]);
+return 0;
+
+}
index 870f655..9ff93f2 100755 (executable)
Binary files a/src/functions/function and b/src/functions/function differ
dissimilarity index 96%
index d9a6ea8..dff185c 100644 (file)
@@ -1,11 +1,11 @@
-#include <stdio.h>
-
-int func(int num);
-
-int main(){
-func(5);
-}
-
-int func(int num){
-printf("%d\n", num * 10);
-}
+#include <stdio.h>     //This includes the standard library.
+
+int func(int num;);    //This line basically is the prototype for the func fuction. It must be similar to. ||
+                       //                                                                                  ||
+int main(){            //This is main, the place where the program goes.                                   ||
+func(5);                       //This executes the func function that we created.                                  ||
+}      //Ends main.       //   /|==========================================================================//
+int func(int num){// <==========|/     //This is basically like main. Instead of saying what the
+                                       //program does, though, we say what the func function does.
+printf("%d\n", num);   //Makes the func function print num, and then a newline.
+}