0

Hi I'm trying to convert a C++ code to a C#, I have searched for a few solutions on the internet, but I can't seem to get any of the results I want. Can anyone help me? Thanks.

The following code is a C++ code.

typedef unsigned char uint8; typedef int sint32; typedef struct BY_BITMAP { sint32 biWidth; sint32 biHeight; sint32 biBitCount; sint32 bfSize; sint32 BytesPerLine; uint8 **ScanLine; uint8 *buffer; }BY_BITMAP; 
4
  • 1
    What do you mean by "convert"? You need te same in C#? Or do you need something so that C++ and C# codes can interact by? Commented Nov 6, 2017 at 7:42
  • We do not know what for what you are using this. Did you read for example: learn.microsoft.com/en-us/dotnet/csharp/programming-guide/… Commented Nov 6, 2017 at 7:42
  • 4
    Truth be told that looks like C code, not C++. Commented Nov 6, 2017 at 7:57
  • If u want the same in C#,what is the challenge?? C# also has structs. If there is a trouble understanding the data types in your C++ code,it is quite simple,you can find their corresponding in C# by a simple search,C# has them all Commented Nov 6, 2017 at 8:24

1 Answer 1

1

If you just want a conversion, I think this is the closest of what you want to achieve?

public struct BY_BITMAP { public int biWidth; public int biHeight; public int biBitCount; public int bfSize; public int BytesPerLine; public byte[][] ScanLine; public byte[] buffer; } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.