473,881 Members | 1,479 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 4717
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
2848
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
23529
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
25743
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
3310
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
1974
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
2963
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
3755
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
2235
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
9776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11102
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10719
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10818
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
10403
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
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4597
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
4196
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3225
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.