C++ Function Definition default argument list

Description

C++ Function Definition default argument list

#include <iostream>
using namespace std;
void pr_msg(char note[]="default value"); // Prototype.
void main()//from w  ww . ja  v a 2s .co m
{
   pr_msg();          
   pr_msg("A new message");  
   pr_msg();                 
   return;
}
void pr_msg(char note[]) 
{
   cout << note << "\n";
   return;
}



PreviousNext

Related