E
Ekim
hello,
I'm using MANAGED C++ and need one of the following two questions answered:
1.)
How can one make a global managed array?
I'm thinking on something like defining
static System::Byte globalArray __gc[];
at the begin of a file. But I get the error
"global Array: cannot declare a global or static managed type object or
a __gc pointer"
anyways, is there a way to define exactly this byte array as global?
-------------
2.)
Why do I always get the message
"unresolved external symbol 'void * __cdecl operator new(unsigned int)'"
when I try to use the new operator for an unmanaged array like this:
static char* globalBuffer = NULL; // global variable
void Test()
{
globalBuffer = new char[100]; // try to allocate memory with
new
}
Do I have to "include" something to be able to use new on chars? I thought
it should work with "It Just Works"-mechanism.
I'm using MANAGED C++ and need one of the following two questions answered:
1.)
How can one make a global managed array?
I'm thinking on something like defining
static System::Byte globalArray __gc[];
at the begin of a file. But I get the error
"global Array: cannot declare a global or static managed type object or
a __gc pointer"
anyways, is there a way to define exactly this byte array as global?
-------------
2.)
Why do I always get the message
"unresolved external symbol 'void * __cdecl operator new(unsigned int)'"
when I try to use the new operator for an unmanaged array like this:
static char* globalBuffer = NULL; // global variable
void Test()
{
globalBuffer = new char[100]; // try to allocate memory with
new
}
Do I have to "include" something to be able to use new on chars? I thought
it should work with "It Just Works"-mechanism.