C++ gurus and learners, we program ourselves :P all work is CC licensed

Friday, November 8

Simple void function use by Usman Sherry

                Use of a Simple Void Function 
 
#include<iostream>
using namespace std;

void function(); ////void type function

int main()
{
function(); //// not necesserely use inside cout statment
cout<<endl; //// as it is a display. Align it properly if needed
return 0;
}

void function() //// returns nothing
{
cout<<"This line would be simpaly displayed if this function is called";
} //// no return used

//////////// you can also use loop for a display i.e. triangle or diamond and function will just print on screen ///////////////////////////

1 comments :