P
p988
In a C# sample code it has the following beginning lines:
using System;
using System.Reflection
[assembly:AssemblyKeyFile ("Keyfile.snk")]
[assembly:AssemblyVersion ("1.0.0.0")]
What's the "keyfile.snk" file and how to generate it? What happens if the
code is compiled like this and the exe is distributed, should the .snk file
be distributed together?
What if the line: [assembly:AssemblyVersion ("1.0.0.0")] is not there? Will
a default version number be generated for this exe?
A book says that:"Remember, you create objects, but you never delete them;
the garbage collector deletes them for you."
What if I just code like following:
class File
{
protected:
int Handle; // File handle
public:
File (char* name)
{
// TODO: Open the file and copy the handle to Handle
}
~File ()
{
// TODO: Close the file handle
}
};
File* pFile = new File ("Readme.txt");
....
delete pFile;
Is "delete pFile" really not going to trigger the destructor, ~File() or
not? If not, why had the author put one there?
using System;
using System.Reflection
[assembly:AssemblyKeyFile ("Keyfile.snk")]
[assembly:AssemblyVersion ("1.0.0.0")]
What's the "keyfile.snk" file and how to generate it? What happens if the
code is compiled like this and the exe is distributed, should the .snk file
be distributed together?
What if the line: [assembly:AssemblyVersion ("1.0.0.0")] is not there? Will
a default version number be generated for this exe?
A book says that:"Remember, you create objects, but you never delete them;
the garbage collector deletes them for you."
What if I just code like following:
class File
{
protected:
int Handle; // File handle
public:
File (char* name)
{
// TODO: Open the file and copy the handle to Handle
}
~File ()
{
// TODO: Close the file handle
}
};
File* pFile = new File ("Readme.txt");
....
delete pFile;
Is "delete pFile" really not going to trigger the destructor, ~File() or
not? If not, why had the author put one there?