473,320 Members | 2,094 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,320 software developers and data experts.

How to fix the error C2893 complile with VC++6.0?

hi all,
How to fix the error C2893 complile with VC++6.0?
Thank you.

Code below:

#include <iostream>

using namespace std;

class Compare
{
public:
template <class UserType>
UserType max(UserType na, UserType nb);
template <class UserType>
UserType min(UserType na, UserType nb);
};

template <class UserType>
UserType Compare::max(UserType na, UserType nb)
{
return (na nb) ? na : nb;
}

template <class UserType>
UserType Compare::min(UserType na, UserType nb)
{
return (na < nb) ? na : nb;
}
int main()
{
Compare a;
a.min(343,33);
return 1;
}
Jun 27 '08 #1
0 1114

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Simon | last post by:
Hi, I'm having a problem with templates and specialisation. I'm using it to overload the same function so it can return different things. I can't see what I'm doing wrong, although my compiler...
3
by: Benedikt Weber | last post by:
I found the following compiler error with Microsoft Visual C++ .NET. I use different functions with return types determined by a Traits class. Function g() below works ok, but when I put the two...
6
by: Basil Fawlty | last post by:
Hi everyone, I have VB.NET 2003 SE, I understand that I can write and compile C and C++ code in this tool. Is that right? If so, how would I go about doing something like that? It won't be...
0
by: Herman Jones | last post by:
I'm getting the following error when I build a Class Library project: Embedding manifest... Project : error PRJ0002 : Error result 1 returned from 'C:\WINDOWS\system32\cmd.exe'. It happens with...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
3
by: dcwbxb | last post by:
Trying to create a program which reads and echos the contents of an input data file, which consists of two records. When I complile my code I keep getting a "error C2001: newline in constant" error....
9
by: fcvcnet | last post by:
Hi, I write a class class CSegment { public: CSegment(void); public: ~CSegment(void); public: CArray< CList< CPoint, CPoint& >, CList< CPoint, CPoint& >& m_curve;
1
by: misu101 | last post by:
Hi, I have a VS 6 project and I am trying to compile it using VS 2005. My program has the atlbase.h include which seems to trigger the errors. It used to compile OK using VS 6. The include...
2
by: yalbizu | last post by:
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; const int NO_OF_STUDENTS=20; struct studentType { string studentFName; string studentLName;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.