Get Paid By Click

Mginger Mobile Money

Dec 22, 2009

Void DataTypes inC by Elvisjino,Datagridview Operation - Tips

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());
}

Easy Way To Pay

Sign up for PayPal and start accepting credit card payments instantly.

Earn While Searching