От: | Kisloid | ||
Дата: | 22.09.06 09:43 | ||
Оценка: | -1 |
public unsafe IntPtr GetSomeString()
{
string someString = "sample string";
sbyte[] buffer = new sbyte [someString .Length + 1];
for (int i = 0; i < someString .Length; i++)
{
buffer[i] = (sbyte) someString [i];
}
buffer[someString .Length] = 0;
fixed (sbyte * p = buffer)
{
return new IntPtr(p);
}
}