473,394 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

error C2143: syntax error : missing ';' before '*'

Hi friends,
I have a problem on Template .
This part of code works fine while running in Visual Studio 6.0 but throws error in VS2005.Error is {error C2143: syntax error : missing ';' before '*'}
------------------------------------------------------------------------------------------------
template <class KEY,class VALUE> const CAssociateArray<KEY,VALUE>::ELEMENT
*CAssociateArray<KEY,VALUE>::ReferElement(int iIndex) const
{
return m_aryElement.GetAddress(iIndex);
}

-------------------------------------------------------------------------------------------------

ELEMENT is a class
CAssociateArray is a class template

Please help me ASAP
do i need to send any more details reg it

Thank U in advance
Jan 30 '08 #1
1 2937
weaknessforcats
9,208 Expert Mod 8TB
You are writing a member function. Therefore, you return an ELEMENT* and not a const CAssociateArray<KEY,VALUE>::ELEMENT*.

Like this:

Expand|Select|Wrap|Line Numbers
  1. class ELEMENT
  2. {
  3.  
  4. };
  5. template <class Key, class VALUE>
  6. class CAssociateArray
  7. {
  8.     public:
  9.         const ELEMENT* ReferElement(int iIndex) const;
  10.  
  11. };
  12. template <class KEY,class VALUE>
  13. const ELEMENT*CAssociateArray<KEY,VALUE>::ReferElement(int iIndex) const
  14. {
  15. //return m_aryElement.GetAddress(iIndex);
  16. }
  17.  
Jan 30 '08 #2

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

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
3
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
2
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project...
0
by: Shashikiran Prabhakar via .NET 247 | last post by:
(Type your message here) Hi, I am not very conversent in VC++, but the requirement for me is to run a rendering code. However i am encountering the following errors. c:\Program...
18
by: George2 | last post by:
Hello everyone, What is wrong with the code, I just want to allocate an array of 100 void* pointers. :-) int main() { void** p;
3
by: sphenxes | last post by:
#include <cmath> #include <ctime> #include <cstdlib> #include <iostream> using namespace std; struct Pharmacology{ string genericName; string tradeName; string classification;
8
by: =?GB2312?B?yum09MXt?= | last post by:
today I forgot to include some header,then I found the error message by the compiler is quite strange. so I want to know exactly the inner details of the compiler impletation,if possible. and I...
15
by: madhu.ab | last post by:
Hi All, I am getting the following errors when i am including header file winuser.h I dont know whats happening. How will an error occur in winuser.h?? Please help. \microsoft visual...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.