R
rickey tom
I'm from the C++ world and the following code does not look right.
Please confirm my suspicions!!!
I have the following method
String __nogc* foo()
{
char someBuffer[1000];
strcpy(someBuffer,"test");
// The compiler accepts this and the program seems to behave fine
return someBuffer;
// My gut feels says that the code really should be
return new String(someBuffer);
}
I'm using Microsoft Visual C# .NET IDE.
Any help here would be greatly appreciated.
Thanks
Rick
Please confirm my suspicions!!!
I have the following method
String __nogc* foo()
{
char someBuffer[1000];
strcpy(someBuffer,"test");
// The compiler accepts this and the program seems to behave fine
return someBuffer;
// My gut feels says that the code really should be
return new String(someBuffer);
}
I'm using Microsoft Visual C# .NET IDE.
Any help here would be greatly appreciated.
Thanks
Rick