473,320 Members | 1,958 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.

Visual C++ to Borland Compiler

Visual c++ compiler survives this:

#define THE_NULL -32767

struct typePair { int v2,v3; };
struct typeTriple { int v1; typePair p; };

typePair EMPTY_PAIR = {THE_NULL,THE_NULL};
typeTriple sv = {THE_NULL, EMPTY_PAIR };
Why does borland compiler return error
Cannot convert 'typePair' to 'int'
since typeTriple is defined as 2nd arg typePair.

It survives this
typeTriple sv = {THE_NULL, {THE_NULL, THE_NULL} };

Thank you
Sep 14 '05 #1
4 1769
Mufe wrote:
Visual c++ compiler survives this:

#define THE_NULL -32767

struct typePair { int v2,v3; };
struct typeTriple { int v1; typePair p; };

typePair EMPTY_PAIR = {THE_NULL,THE_NULL};
typeTriple sv = {THE_NULL, EMPTY_PAIR };
Why does borland compiler return error
Cannot convert 'typePair' to 'int'
since typeTriple is defined as 2nd arg typePair.

It survives this
typeTriple sv = {THE_NULL, {THE_NULL, THE_NULL} };

Thank you


I'm not sure which version of Borland C++ or Visual C++ you have, but
that code doesn't pass on my VC++ 6.0 (sp6) or Microsoft .NET 2003 (at
dinkumware.com). It does work on g++ 3.4.1, EDG (also at
dinkumware.com), and Comeau C++ (comeaucomputing.com). Since the latter
two are the most standard compliant, it seems likely that Borland is
non-conformant at that point.

BTW, in C++, it is generally preferable to use a constructor over
array-style initialization:

struct typePair
{
typePair( int a_v2, int a_v3 ) : v2( a_v2 ), v3( a_v3 ) {}
int v2,v3;
};

struct typeTriple
{
typeTriple( int a_v1, const typePair& a_p ) : v1( a_v1 ), p( a_p )
{}
int v1;
typePair p;
};

typePair EMPTY_PAIR( THE_NULL, THE_NULL );
typeTriple sv( THE_NULL, EMPTY_PAIR );

Cheers! --M

Sep 14 '05 #2
"mlimber" <ml*****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com
Mufe wrote:
Visual c++ compiler survives this:

#define THE_NULL -32767

struct typePair { int v2,v3; };
struct typeTriple { int v1; typePair p; };

typePair EMPTY_PAIR = {THE_NULL,THE_NULL};
typeTriple sv = {THE_NULL, EMPTY_PAIR };
Why does borland compiler return error
Cannot convert 'typePair' to 'int'
since typeTriple is defined as 2nd arg typePair.

It survives this
typeTriple sv = {THE_NULL, {THE_NULL, THE_NULL} };

Thank you


I'm not sure which version of Borland C++ or Visual C++ you have, but
that code doesn't pass on my VC++ 6.0 (sp6) or Microsoft .NET 2003 (at
dinkumware.com). It does work on g++ 3.4.1, EDG (also at
dinkumware.com), and Comeau C++ (comeaucomputing.com). Since the
latter two are the most standard compliant, it seems likely that
Borland is non-conformant at that point.


Microsoft .NET 2003 compiles it just fine for me.

--
John Carson
Sep 14 '05 #3
"John Carson" <jc****************@netspace.net.au> wrote in message
news:dg***********@otis.netspace.net.au

Microsoft .NET 2003 compiles it just fine for me.


I am referring to an installation on my hard drive. Not some dinkumware
thing accessed over the web.

--
John Carson

Sep 14 '05 #4
John Carson wrote:
[snip]
Microsoft .NET 2003 compiles it just fine for me.


I don't actually have it; I just tried it here:

http://www.dinkumware.com/exam/dinkumExam.aspx

and it still fails. It's possible that it's a difference in
configuration or that DinkumWare app prints the wrong version.

Cheers! --M

Sep 14 '05 #5

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

Similar topics

1
by: Eric | last post by:
It seems like this is the second time I have come across this with a Pythonmodule, and I'd like to get some perspective on it. I tried to build PyPerl (on my Win XP machine) and got the following:...
11
by: Goonigooguu | last post by:
Help! I am looking to download an evaluation version of Microsoft Visual Studio 6.0 to practice some C++ programming or alternatively a similar program which is easy to use and learn basic C++ on....
17
by: Ziggi | last post by:
Hi. I want to get a C++ IDE, but I dont know whether to go for Bill Gate's solution or Borland's. Could any kind folks detail the relative strength and weaknesses of both, and also tell me which...
15
by: Chris | last post by:
I am just beginning programming again and need a bit of advice. I have both Visual C++ 6.0 Standard Edition and Borland C++ Builder 6. Of these two which do you consider the best for programming...
5
by: Mark - KF8RV | last post by:
Which to purchase is the question. My Borland 4.5 C/C++ compiler is old. The personal or student version of either BBC++ or MVC++ is being investigated for home use. My personal preference...
2
by: kikotores | last post by:
I am going back home for the summer but I have this big project to submit for one of my classes. It is written in Visual C++ 7.0 . Hoever the only C++ compiler I have at home is the free Borland...
140
by: Oliver Brausch | last post by:
Hello, have you ever heard about this MS-visual c compiler bug? look at the small prog: static int x=0; int bit32() { return ++x; }
3
by: MS | last post by:
Hi, I'm trying to find out whether Borland C 4.5 and MVC still exist. I'm doing so as I have code that was compiled by them originally and wnated to recompile it using that code to do some...
45
by: mistral | last post by:
Does Visual C++ 2005 Express Edition produce small, compact C executables? Or there is another C compilers that do this better? m.
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
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)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.