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

C2601: local function definitions are illegal

P: 5
Hi Guys I have some problem with C++ its give me error C2601

C2601:Compare: local function definitions are illegal
C2601:FindPattern: local function definitions are illegal


Expand|Select|Wrap|Line Numbers
  1.     bool Compare(const BYTE* pData, const BYTE* bMask, const char* szMask)
  2.     {
  3.         for (; *szMask; ++szMask, ++pData, ++bMask)
  4.         if (*szMask == 'x' && *pData != *bMask)
  5.             return false;
  6.         return (*szMask) == NULL;
  7.     }
  8.  
  9.  
  10.     DWORD FindPattern(DWORD Address, DWORD offset, BYTE* bMask, char* szMask)
  11.     {
  12.         for (DWORD i = 0; i < offset; i++)
  13.         if (Compare((BYTE*)(Address + i), bMask, szMask)) return (DWORD)(Address + i);
  14.         return 0;
  15.     } 

Thanks
Oct 21 '15 #1
Share this Question
Share on Google+
2 Replies


P: 5
Solved. I did put all codes in another class.
Oct 21 '15 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
I have no idea what you solved but your reported error is not in the code you posted.

What class are you talking about? All the code looks like C and there are no classes in C.
Oct 21 '15 #3

Post your reply

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