With VS 2010 Professional, I created a new C++ Project. In C# projects, I often used the feature “Go to definition” (or just pressed the F2 key) in the context menu after mark a specific line of code. I also want this same behavior/feature in C++ projects, but, unfortunately, in C++ projects, it doesn’t work. Both “Go to definition”, “Go to declaration”, and also “Go to Header File” don’t work. Nothing happens, no error message, nothing. What’s wrong?
Let’s say, I’ve for example the following line of code:
wstring str = L"blah";
There are neither warnings, nor messages from the compiler. Also printing str on the console works fine. So, all should be ok. If I now mark L (should be a macro or something like that?) and try to navigate to the declaration, definition or header file, nothing happens. Is that by default or is something wrong with VS?
L is a prefix to ‘widen’ string literals.
You get a
const wchar_t*instead of just aconst char*from an expression like that.It is not a macro, it is part of the language, like the suffix f for a float constant
1.333333f which denotes the precision.