Sign in to follow this  
Raeldor

Compiler alert to test[ x,y] arrays in c++

Recommended Posts

Is there anyway to have the compiler alert when it sees arrays being referenced as... test[x,y] I am coming from c#, and I keep referencing my arrays like this which is causing me serious grief. Why does c++ even have this format anyways, if it doesn't support it? BTW, I am using VS2003 .NET. Thanks

Share this post


Link to post
Share on other sites
The problem is that "x,y" is a valid expression, and the array index can be any expression of the correct type. I believe gcc is able to emit a warning in this case but I don't believe Microsoft C++ will do so unless you make the mistake inside an if statement.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this