From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/SYNTAX/void.html | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 reference/C/SYNTAX/void.html (limited to 'reference/C/SYNTAX/void.html') diff --git a/reference/C/SYNTAX/void.html b/reference/C/SYNTAX/void.html new file mode 100644 index 0000000..51c5b03 --- /dev/null +++ b/reference/C/SYNTAX/void.html @@ -0,0 +1,104 @@ +The VOID keyword. + + + + +
+

The VOID keyword.

+
+

+The void keyword +allows us to create functions that either do not require any +parameters or do not return a value.

+The following example shows a function that does not return +a value. +

+ + + + +
+
+
+	void Print_Square(int Number);
+
+	main()
+	{
+	   Print_Square(10);
+	   exit(0);
+	}
+	
+	void Print_Square(int Number)
+	{
+	   printf("%d squared is %d\n",Number, Number*Number);
+	}
+
+
+

+The next example shows a function that does not require any parameters: +

+ + + + +
+
+
+	#include 
+	#include 
+
+        int Random(void);
+
+        main()
+        {
+           printf("A random number is %d\n", Random());
+           exit(0);
+        }
+
+        int Random(void)
+        {
+	   srand((unsigned int)time((time_t *)NULL));
+	   return( rand());
+        }
+
+
+
+

+


+

Example:

+ +void example +
+

See also:

+ +Functions +Void pointers +

+ + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + -- cgit v1.2.3-54-g00ecf