On Monday, 4 September 2023 at 07:39:21 UTC, confused wrote:

So then I guess I'd still like to know how I'm expected to store and access an array of characters without the C runtime as I tried in my original post.

Without C runtime functions such as malloc you can still have fixed-length arrays, for string variables the compiler will emit null-terminated string at compile time in cases like that making it compatible with C functions.

Note that it not the case for other string operations like concat operator (is it available in betterC?), in that case if you want to pass the resulting string you have to add null terminator by hand.

If you need to allocate memory at runtime and still wan't to avoid C runtime, well I guess you have to do some syscalls then... Or use another allocator library, jmalloc maybe? Though I don't have the experience with them and don't know if they are using C runtime somewhere inside or handle that low level OS/syscalls stuff by itself.
  • Re: I don't unde... confused via Digitalmars-d-learn
    • Re: I don't... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: I d... confused via Digitalmars-d-learn
        • Re:... bachmeier via Digitalmars-d-learn
          • ... confused via Digitalmars-d-learn
            • ... bachmeier via Digitalmars-d-learn
        • Re:... evilrat via Digitalmars-d-learn
          • ... confused via Digitalmars-d-learn
            • ... Jonathan M Davis via Digitalmars-d-learn
            • ... confused via Digitalmars-d-learn
            • ... evilrat via Digitalmars-d-learn
            • ... rempas via Digitalmars-d-learn
        • Re:... ryuukk_ via Digitalmars-d-learn
          • ... confused via Digitalmars-d-learn
            • ... evilrat via Digitalmars-d-learn

Reply via email to