Click here to Skip to main content
14,362,565 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 4:37
memberhoney the codewitch19-Sep-19 4:37 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
Stuart Dootson19-Sep-19 4:47
professionalStuart Dootson19-Sep-19 4:47 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 4:50
memberhoney the codewitch19-Sep-19 4:50 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
Steve Naidamast19-Sep-19 6:11
professionalSteve Naidamast19-Sep-19 6:11 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 6:28
memberhoney the codewitch19-Sep-19 6:28 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 7:50
memberzezba900019-Sep-19 7:50 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 7:53
memberhoney the codewitch19-Sep-19 7:53 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 8:06
memberzezba900019-Sep-19 8:06 
This is what "Span<t>" is for. Return that instead of an array and your API will be "managed" in the sense to an external user.

Or you can use "GCHandle.Alloc" to pin a managed array in memory.

GCHandle.Alloc Method (System.Runtime.InteropServices) | Microsoft Docs[^]


Using Span<t> is a better idea though.
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 8:09
memberhoney the codewitch19-Sep-19 8:09 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 8:17
memberzezba900019-Sep-19 8:17 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 8:17
memberhoney the codewitch19-Sep-19 8:17 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 8:20
memberzezba900019-Sep-19 8:20 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 8:21
memberhoney the codewitch19-Sep-19 8:21 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 8:26
memberzezba900019-Sep-19 8:26 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 8:28
memberhoney the codewitch19-Sep-19 8:28 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 8:35
memberzezba900019-Sep-19 8:35 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 8:37
memberhoney the codewitch19-Sep-19 8:37 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 8:43
memberzezba900019-Sep-19 8:43 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 8:51
memberhoney the codewitch19-Sep-19 8:51 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 9:01
memberzezba900019-Sep-19 9:01 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 9:28
memberhoney the codewitch19-Sep-19 9:28 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 9:37
memberzezba900019-Sep-19 9:37 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 9:41
memberhoney the codewitch19-Sep-19 9:41 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
zezba900019-Sep-19 10:05
memberzezba900019-Sep-19 10:05 
GeneralRe: I thought .NET was supposed to make things easier, if anything, than unmanaged code. Pin
honey the codewitch19-Sep-19 10:13
memberhoney the codewitch19-Sep-19 10:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.