fork download
  1. [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
  2. struct ManagedStruct
  3. {
  4. int i;
  5. }
  6.  
  7. struct CSharpConverterStruct {
  8. ManagedStruct manStruct;
  9. }
  10. struct CSharpStruct {
  11. private IntPtr ptr;
  12. private CSharpConverterStruct * GetPointer() {
  13. unsafe {
  14. return (CSharpConverterStruct *)ptr;
  15. }
  16. }
  17. CSharpStruct() {
  18. GetSomePtr(ptr);
  19. }
  20. property ManagedStruct StructData{
  21. get { return GetPointer()->manStruct; }
  22. }
  23. }
  24.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(13,9): error CS0227: Unsafe code requires the `unsafe' command line option to be specified
prog.cs(20,28): error CS1041: Identifier expected
prog.cs(20,38): error CS8025: Parsing error
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty