Code:
#include<iostream>
#include<conio.h>
using std::cout;
using std::cin;
using std::endl;
// function prototype
void printSquare( int );
int main()
{
// declare variable
int side;
// read side
cout<<"enter square side:";
cin>> side;
// display square
printSquare( side );
getch();
}
// define printSqaure
void printSqaure( int userchoice )
{
for( int i=1; i<=userchoice; i++ )
{
cout<<endl;
for( int j=1; j<=userchoice; j++)
cout<< '*' ;
}
}
It does not print asterick square(*)
****
****
****
****
Where is the fault?
It gives the following error
[Linker error]undefined reference to'printsquare(int)'