Hi,
I'm trying to write a class to hold two variables to be used by a number of functions in the program. Here's the class:
Code:
class InBAF
{
private:
static char location;
static CString server;
public:
static void SetLocation(char newloc)
{
location = newloc;
}
static void SetServerName(char location)
{
switch (location)
{
case 'T':
// Input Toronto Server
server = "ftp.pureftpd.org";
break;
case 'M':
// Input Montreal Server
server = "ftp.pureftpd.org";
break;
}
}
static CString GetServerName()
{
return server;
}
};
char InBAF::location = 'N';
CString InBAF::server = '\0';
when I try to compile I get this error for each member of the class:
Code:
private: static char InBAF::location" (?location@InBAF@@0DA)
already defined in GetData.obj
GetData is a different function in my project; it has nothing to do with this class.
What am I missing?
and I tried:
Code:
CString InBAF::server[0] = '\0';
but this comes up:
Code:
error C2466: cannot allocate an array of constant size 0
error C2040: 'private: static class CString InBAF::server' : 'class CString []' differs in levels of indirection from 'class CString'