Just a litle careless but

Just a litle careless...but as I found both commands work fine.

    File ConfigFile (File::getSpecialLocation(File::SpecialLocationType::commonApplicationDataDirectory)

    String MsgFile (File::getSpecialLocation(File::SpecialLocationType::commonApplicationDataDirectory)
                           .getChildFile(Val_MessagesFileName + AppCfg.AppConf.App_WorkingLanguage)

Because , getFullPathName()  returns a String , obviously the second command is the only correct one.

Any explanation ?


Where is the code from?  Like you say yhey both look okay.... and would be correct in different circumstances.

I'm trying to implement a general-purpose environment for my Juce application.
The above code is just a piece from it.



Maybe I'm missing something, but in the first one you are defining a File object, and the second one a String.  In the first you don't need the getFullPathName() but it'll work with it.

What's the problem?

No problem really exists.

The first statement returns a string object, which is used by the File class constructor to create a File object.
The second one simply returns a string object.

After many-many hours of work I was confused.