samedi 27 février 2021

Static Member Variable, Qualified Name is Not Allowed

I've searched other answer's on SO and feel like I'm following the format correctly, so not sure what Im doing wrong and am at my wits end with this one....

class DBwrapper {
    private:
        static std::string DBfile;
        //static char DBfile[];
#include "DBwrapper.h"
#include <string>
int main()
{
    std::string DBwrapper::DBfile = "library.db3";
    std::string DBwrapper::DBfile{"library.db3"};
}

In VS, I get red squiggles in main.cpp under DBwrapper::DBfile saying "Qualified name is not allowed". I've tried with char [] as well as const/not const.

Aucun commentaire:

Enregistrer un commentaire