By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,470 Members | 924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,470 IT Pros & Developers. It's quick & easy.

Pls identify the error in the following code. It is showing declaration syntax error

P: 1
#include<iostream.h>
#include<conio.h>
#include<stdio.h>

void package();

void main()
{
clrscr();

char name[20];

void package()
{
cout<<"enter name";
gets(name);

}

getch();
}
Jun 12 '16 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
You have defined your package function inside main(). You define the function outside of main() but you call the function from inside main().
Jun 12 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.