I'm getting an error saying "LINK : fatal error LNK1561: entry point must be defined"

What should I do? Here's my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<iostream>

using namespace std;

void pattern(int n)
{
if(n == 1)
{
 
	cout << '*' << endl;
	cout << '*' << endl;
}
else
{
	for(int i = 1; i <= n; i++) cout << '*'; cout << endl;
	pattern(n-1);
	
	for(int i = 1; i <= n; i++) cout << '*'; cout << endl;
}
If that is all, you did not finish with a } and you do not have a main function
closed account (2LzbRXSz)
Is that your full code? If so, then that's probably because you don't have a main function!
Oh, and you're missing a curly bracket at the end.

Topic archived. No new replies allowed.