Jump to content
  • Advertisement
Sign in to follow this  
codingo

Syntax I've never seen before

This topic is 2133 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

I'm implementing a licensing api that has lib files written in C (which may have something to do with the exotic syntax). My application is written in C++ and I've never used C before. It looks like this:

License::License(int productID, const wstring version, etc)
{
     d_LicenseFilePath = L"";//?????????????
}

can't make sense of the: L"" value.  Is there a guru out there that knows?

Share this post


Link to post
Share on other sites
Advertisement

Though you know that that function is C++, and not C, because it uses std::wstring (the wide char version of std::string).

(It's also definitely a C++ piece of code, because it's in a class constructor).

 

L"" is C++ just as much as L"" is C, so here it wouldn't be considered "intermingling" C and C++, but just C++ code.

 

What I mean to say is, don't think of L"" as 'C'. It's fully C++ even if C also has that feature. C also has variables, but when you encounter variables in C++, you don't think of variables as "Oh, that's a C thing".

Share this post


Link to post
Share on other sites

in that sence couldn't you say the same thing about C in its entirety since C++ is a subset of C?

 

Which leads to the question: if "wstring d_LicenseFilePath;" was declared as a private member var of the class, why establish the wstring literal type again in the constructor?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!