I am primarily a C++ programmer. However, I have recently been assigned some programming tasks that require the use of C#.

Currently I am writing code to open and query a proprietary database. There are 4 fields of input data required from the user and I will be returning 2 fields.

In C++ I would provide the user with 2 structures. Here is my C# attempt.

Code:
public struct TInputQuery
{
    char[] szZipCode    = new char[6];
    char[] szZip4 Code = new char[5];
    char[] szDpCode     = new char[3];
    char[] szRoute        = new char[6];
}

public struct TAnswer
{
    char szFlag;
    char szSequence = new char[5];
}
Ofcourse, I can not do that in C#. I get plenty of errors about not having initializers in structs.

So, my question is - How do I provide my users with a custom data type for submitting the input and providing the output?

On a side note: Have many C++ programmers found the learning curve for C# to be particularly difficult?

I have had a few programmers insinuate that it was quite easy. However, I find it to be the opposite. The similarities in the syntax make it seem familiar and comfortable, but the way it works and handles data under the covers is quite different and takes a while to really understand and then to reflect that in the way you code.

Kendall