3 ms·
An existing alternative is to put an array in a struct: struct string123 { char data[123]; }; Then create functions that user pointers to th
by antiquark 6y ago
An existing alternative is to put an array in a struct:
struct string123 {
char data[123];
};
Then create functions that user pointers to these string123 structs.
- WalterBright 6y agoThat does work, except for: 1. variable length buffers 2. every other piece of code you want to interface with uses `char*`
- david2ndaccount 6y agoIf you want a pointer to a fixed size array, just use one, eg char (*data)[123]; // syntax is somewhat awkward
- mav3rick 6y agoYou can type def that