Feed on Posts or Comments

The Plaid Cow on 02 Jun 2005

Microsoft Visual C++ Annoyances

One of the efforts thta I have been taking on at work recently is ensuring that a 50K line simulation will compile in Microsoft Visual C++ as well as Borland C++ and gnu C++. Without errors. Without warnings.

Some of the code has been a challenge, like the change on scope of variables initialized in a loop construct. In several cases I ended up just wrapping the entire for block in another set of braces. Another quirk comes with the following code which gives a syntax error:

int a, *b(&a);

While what looks like the equivalent code compiles just fine:

int a, *b = &a;

Anybody know what is going on here?

Subscribe to the comments through RSS Feed

Leave a Reply