J
Jay
In C++ I can initialise a struct as follows:
struct fileInfo {char filename[STRLEN]; int gotFile; int ch; int ln;};
fileInfo configFile = {"", 0, 1, 1};
Is there a similar way to initialise a struct in C#? The compiler flags an error at the opening
curly brace of the second line of the following:
struct fileInfo {string filename; int gotFile; int ch; int ln;}
fileInfo configFile = {"", 0, 1, 1};
I add a constructor that takes four parameters, but that seems quite wordy. Is there a better way?
struct fileInfo {char filename[STRLEN]; int gotFile; int ch; int ln;};
fileInfo configFile = {"", 0, 1, 1};
Is there a similar way to initialise a struct in C#? The compiler flags an error at the opening
curly brace of the second line of the following:
struct fileInfo {string filename; int gotFile; int ch; int ln;}
fileInfo configFile = {"", 0, 1, 1};
I add a constructor that takes four parameters, but that seems quite wordy. Is there a better way?