I changed the definition to indiciate that the constant should be externally linked. I did this by using the extern const strTest = "Test" in main.cpp. The project compiles correctly. However, when I assign strTest to a static member variable of a class (the static member definition occurs in the .cpp file), it fails to assign the data "Test" to the variable. I put a break point on the assignment line to discover the data contained by strTest is believed to be "". If I place the definition in the .h file, removing the extern, this issue does not occur. However, I want the definition to exist in the cpp file. Is there any reason strTest would be "" despite the constant definition assigning "Test" to it?
Edit: Further testing by placing a breakpoint at the line of code that assigns "Test" to strTest occurs AFTER the static member variable assignment. Why is this the case? Aren't const assignments suppposed to have precedence?
Thank you.