Jump to content
  • Advertisement
Sign in to follow this  
Ra

MSVC++2K5EB bug?

This topic is 4960 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Alright, I've been trying to figure out why this code doesn't compile with MS Visual C++ 2005 Express Beta. According to #gamedev it should work fine. Any ideas? I can work around it, but it'd be nice if this actually worked. Note: I'm using C, not C++.
/* ERROR: "initializer is not a constant" on line "{ foo[0] }" */

#include <stdio.h>

char const * const foo[1] =
{
        "test"
};

struct
{
        char const * const blah;
}
const moo[1] =
{
        { foo[0] }
};

int main(void)
{
        printf("blahblahlbahla\n");
}




Share this post


Link to post
Share on other sites
Advertisement
I'm running version 8.0.40607.16 (beta1.040607-1600) and that code compiles fine. Not that that's much help to you, sorry.

Share this post


Link to post
Share on other sites
Do you have Compile as C Code (/TC) set in Configuration Properties -> C/C++ -> Advanced?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!