zTail needs to be a char* eg: ``` char *zSql = <the SQL CString> char *zTail = 0; int bytesused = -1; sqlite3_prepare(... zSql ... &zTail); if (zTail) bytesused = (int)((IntPtr)zTail-(IntPtr)zSql); ... ``` The size of zTail and zSql are the size of a pointer (32-bit for 32-bit or 64-bit for 64-bit). bytesused will contain the number of bytes used, or -1 if all of them was used. NB: I don't know C# -- as a Microsoft language I assume it is completely broken for all purposes so I have no idea how you interface C# with a actual computer code