473,749 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error: local function definitions are illegal!

12 New Member
Hi ppl can anyone tell me what this error means?
error C2601: 'meanData' : local function definitions are illegal
Feb 6 '07 #1
1 4711
horace1
1,510 Recognized Expert Top Contributor
Hi ppl can anyone tell me what this error means?
error C2601: 'meanData' : local function definitions are illegal
it happens when you try to define a function within a function, see
http://msdn2.microsoft .com/en-us/library/sba3hty9.aspx

e.g. I try to define function meandata() within function fg1()
Expand|Select|Wrap|Line Numbers
  1. int fg1()
  2. {
  3.      int meanData() { return 1; }
  4.      int j=meanData();
  5.      return j;
  6. }
when I compile it using Visual C I get the error message
m.cpp(5) : error C2601: 'meanData' : local function definitions are illegal

define it outside fg1()
Expand|Select|Wrap|Line Numbers
  1. int meanData() { return 1; }
  2.  
  3. int fg1()
  4. {
  5.      int j=meanData();
  6.      return j;
  7. }
  8.  
Feb 6 '07 #2

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

Similar topics

0
2839
by: Putz Ronald | last post by:
Hy! I am trying to convert a win Oracle application to solaris! We have use external c functions which I have ibncluded in a shared object. See the makefile below: OBJECTS = definitions.o eventlog.o arc_xpi.o OracleFuncs.o DEFS = -DOS_SOLARIS -fPIC -G
0
23507
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub) 5: Procedure call or argument is not valid. 6: Overflow. 7: Out of memory.
15
25727
by: unknownbomb | last post by:
Hey all i really hope you can help me out. Im compiling a project and im getting 2 errors which are saying local function definitions are illegal. Anyone know what this mean? And especially HOW to fix it?? Thanks.. Sorry if this is a noob question.. I AM still a noobcoder. Greetz
3
3298
by: Mikail Dellovich | last post by:
I am on a Solaris 10 6/06 SPARC machine. I tried to compile sound player app for Asterisk and got the following error: Can someone provide an explanation or work around? Thanks! xxdev2:12:24:/opt/sft/voip/asterisk-addons-1.2.5/format_mp3gmake gcc -pipe -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -I/usr/include/ -I/u01/app/oracle/product/primary/rdbms/public/...
2
1967
by: GC2006 | last post by:
//Error 1 error C2601: 'computeBestHotelBestMonth' : local function definitions are illegal e:\project 3\prj 3b.cpp 90 //Error 2 fatal error C1075: end of file found before the left brace '{' at 'e:\project 3\prj 3b.cpp(68)' was matched e:\project 3\prj 3b.cpp 104 #include <iostream> #include <fstream> using namespace std; const int HOTELS = 5; const int MONTHS = 12; void displayGuests(int); int computeYearlyHotelGuest(int);
9
2957
by: i | last post by:
#include<stdio.h> #include<conio.h> #include<process.h> #include<string.h> char ch; int n,m; void main(); char check(int,int,char); void cash(int,int,char); void debit_card(int,int,char);
4
3747
by: Chronictank | last post by:
Hi, as a bit of background (and seeing as it is my first post :)) i am a complete newbie at perl. I literally picked it up a week ago to do this project as it seemed like the best choice for a language to connect to a SQL database in a Unix envirment as well as script parsing so there is more than likely a ton of things i could have done a better way. I have been at this for 3 days now and cant for the life of me work out why the code is...
13
379
by: JOYCE | last post by:
Please help me,I don't know where the error is.The following is my programming. #include<stdio.h> #define SIZE 99 void mean (const int answer); void median(int answer); void mode(int freq,const int answer); void bubbleSort (int a); void printArray(const int a); int main(){
3
2233
by: charmeda103 | last post by:
I keep getting errors and i looked relooked I cant seem to see what wrong. from my code can see u where the errors are coming from. here are the error messages: 1.warning C4101: 'size' : unreferenced local variable 2. warning C4553: '==' : operator has no effect; did you intend '='? 3. warning C4101: 'userAnswer' : unreferenced local variable 4.error LNK2019: unresolved external symbol "void __cdecl FillUpTheBoard(int,char *...
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.