Microsoft Visual C++ Annoyances

June 2nd, 2005 | Tags:

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?

No comments yet.
You must be logged in to post a comment.