C++ Logo


Advanced search

Subject: Re: A UTF-8 environment specification; an alternative to assuming UTF-8 based on choice of literal encoding
From: Thiago Macieira (thiago_at_[hidden])
Date: 2021-07-30 11:22:43

On Friday, 30 July 2021 08:41:13 PDT Tom Honermann wrote:
> True today, but I suspect their location is subject to change (though
> probably unlikely).

It's guaranteed by ABI.

> Is there a straight forward way to determine their location in memory?

Yes from main, because you got a pointer to argv and nothing can have modified
them yet.

After main(), even if you get a pointer to them, you can't be sure they
haven't been modified / clobbered / overwritten, so that's not useful.

On Windows, GetCommandLineW() is always valid.

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

SG16 list run by sg16-owner@lists.isocpp.org