- Code: Select all
BOOL GL_Window::Initialize ()
{
...
{
using namespace glGraph;
g_graph = new CglGraph();
}
...
}
I try doing:
- Code: Select all
g_graph = new glGraph::CglGraph();
But that causes compiler errors. Any clues?
Moderators: SecretSquirrel, just brew it!
BOOL GL_Window::Initialize ()
{
...
{
using namespace glGraph;
g_graph = new CglGraph();
}
...
}
g_graph = new glGraph::CglGraph();#include <stdio.h>
namespace ns1
{
class c1
{
public:
c1() { printf("c1()\n"); };
~c1() { printf("~c1()\n"); };
};
typedef c1 *c1ptr;
};
int main(int argc, char* argv[])
{
printf("enter main()\n");
ns1::c1ptr p;
{
p = new ns1::c1();
delete p;
}
printf("exit main()\n");
return 0;
}
#include <stdio.h>
namespace ns1
{
class c1
{
public:
c1() { printf("c1()\n"); };
~c1() { printf("~c1()\n"); };
};
typedef c1 *c1ptr;
};
namespace ns2
{
class c2
{
public:
c2() { printf("c2()\n"); };
~c2() { printf("~c2()\n"); };
void Initialize();
ns1::c1ptr p1;
};
typedef c2 *c2ptr;
};
void ns2::c2::Initialize()
{
printf("c2::Initialize()\n");
p1 = new ns1::c1();
delete p1;
}
int main(int argc, char* argv[])
{
printf("enter main()\n");
ns2::c2ptr p2;
{
p2 = new ns2::c2();
p2->Initialize();
delete p2;
}
printf("exit main()\n");
return 0;
}
Buub wrote:Oh by the way, the correct C++ standard variable to use is "bool", not the old MS macro "BOOL".
BOOL GL_Window::Initialize ()
{
...
g_graph = new glGraph::CglGraph();
...
}
Users browsing this forum: No registered users and 2 guests