Thread: Constant Being Initialized AFTER Variable That Uses It

  1. #16
    Me
    Join Date
    Jul 2006
    Posts
    71
    Quote Originally Posted by Dave_Sinkula
    Why not "buy" gcc?
    Really, why not buy something if you plan on using it a lot?(sarcasm)

  2. #17
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Are we agreed the behavior in MSVC++ 6 is incorrect for the code I wrote?
    Yes. It is definitely incorrect. Your code is fine.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #18
    Registered User
    Join Date
    Nov 2005
    Posts
    88
    Oh, I find the MSVC++ environment to be rather accomodating, especially when I am developing in Windows for windows with a lot of API programming. Also, it makes it easier when I have to deal with other developers who use MSVC++ as well.

    I have only encountered a few other minor issues with MSVC++ even with reasonably heavy used of the STL. I do believe despite having some compiler issue, the MSVC++ 6 compiler was supposed to produce faster executables do to some compiler optimizations.

  4. #19
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I don't think that to be true anymore. Not with 8 years on top of that to produce better and faster compilers. But I may be wrong.

    I do agree that Visual Studio 6 was a great tool though. But I think if that is the only reason, you need to move on. VC++ 2005 Express Edition is free and, you will find, a much better product
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #20
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    I will test the code in my VC++6 and tell you if it works or not. But it may work if you don't make it const. Only in this case you can omit the extern keyword in other.cpp.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  6. #21
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Yes, it worked correctly in my MSVC++6.
    Please send complete code. For example you didn't include string in other.cpp.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  7. #22
    Registered User
    Join Date
    Nov 2005
    Posts
    88
    Siav:
    Thanks for the information. I do not want to make it non-const just to ensure I do not accidentally modify the string later down the line. The code, with the #include <string> added exhibits the error for me. I am using MSVC++ 6.0 SP6.

    Mario:
    If I am not mistaken, VC++ 2005 Express did not have the capability to create dll projects. I would happily move on, but for the moment, for the many aspects of my project, it is best to stay on MSVS 6 until I can afford a professional edition of .NET or 2005.

  8. #23
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Call me Sia if you need a shorter name.
    I use MSVC++6 without any service pack and it executed YOUR code correctly. So maybe there is some other problems with your code.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a sysctl variable ?
    By taupin in forum C Programming
    Replies: 4
    Last Post: 06-28-2008, 05:21 PM
  2. Replies: 12
    Last Post: 05-28-2008, 04:10 AM
  3. Need some help...
    By darkconvoy in forum C Programming
    Replies: 32
    Last Post: 04-29-2008, 03:33 PM
  4. static class variable vs. global variable
    By nadamson6 in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2005, 03:31 PM
  5. Replies: 2
    Last Post: 04-12-2004, 01:37 AM