Deutsch English Français Italiano |
<va76q6$dljb$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thiago Adams <thiago.adams@gmail.com> Newsgroups: comp.lang.c Subject: Re: valgrind leak I can't find Date: Thu, 22 Aug 2024 08:18:30 -0300 Organization: A noiseless patient Spider Lines: 32 Message-ID: <va76q6$dljb$2@dont-email.me> References: <j8idnQlHTPZXZFv7nZ2dnZfqn_GdnZ2d@brightview.co.uk> <va75pv$djqu$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 22 Aug 2024 13:18:31 +0200 (CEST) Injection-Info: dont-email.me; posting-host="85c23c65ebcc3c54f3fb7aecb1a9f458"; logging-data="448107"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rWThjXHNCBhAHfyRbYUbZSMWPuZ4fXRA=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:7OZC5BOKoYtTvD35aPySO9wYuPs= In-Reply-To: <va75pv$djqu$1@dont-email.me> Content-Language: en-US Bytes: 1912 On 22/08/2024 08:01, Bart wrote: > On 22/08/2024 09:41, Mark Summerfield wrote: > >> This is the type's struct: >> >> typedef struct { >> int _size; >> int _cap; >> char** _values; >> } VecStr; > > What's with the leading underscores for member names? > > It means ending with ->_ later on, which seems pointless extra clutter. C++ is responsible for this. C++ made the usage of 'this->' optional when calling member functions. As a result, when C++ programmers encounter 'i' in the middle of a function, they might not know where it comes from. If 'this->' were not optional, 'this->i' would clarify that. To avoid confusion, many C++ programmers use prefixes like 'm_' that can't be ignored. Since many C programmers also work in C++, this pattern can sometimes influence C code as well.