🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1851

Re: C and its pesent 'ancestos'

#1851
From: Bonita Montero
Date: Thu, 26 Nov 2026 10:10
62 lines
4251 bytes
Am 26.11.2026 um 11:02 schrieb fir:

> btw, no one understand the neccsity of
> 
> int tab[100];
>   tab.length*=3;

In C++ you dont' have to do that. In C++ you simply use emplace_back
and let the templated runtime to the growing of the capacity. No need
to handle with pointers yourself. And accessing the contents of a
container is bounds-checked while debugging (optional with libstdc++,
default with VC++).

> classic c arrays but bused on realloc internally and thus being able to 
> be resized freely (i already made tham in my own compiler (unfinished)
> ) you just emit calls to reallock when you meed those reallocking cyntaxes

In C++ the contained values of a vector could have an arbitrary type and
if the values are moveable a resize is very cheap. Doing this in C is a
magnitude more work.

> void EmitResizeFromEax(chunk name)
> {
>                FlushOutAsm("\n push eax" );
> 
>                FlushOutAsm("\n push eax" );
>         FlushOutAsmChunkPE("\n  push (", name, ") ");
>                FlushOutAsm("\n   call (\"msvcrt.dll\"->realloc)");
>         FlushOutAsmChunkPE("\n    mov (", name, ") eax ");
>                FlushOutAsm("\n     pop edx");
>                FlushOutAsm("\n      pop edx");
>         FlushOutAsmChunkPE("\n       mov (", name, ") eax ");
>                FlushOutAsm("\n      pop eax");
>         FlushOutAsmChunkPE("\n         mov (", name, "_size) eax ");
> 
>      if(emit_basic_debug_info_for_initial_reallocks)
>      {
> //          FlushOutAsm("\n    mov eax (__realloc_sum_counter) ");
> //          FlushOutAsm("\n    add eax %d", size);
> //          FlushOutAsm("\n    mov (__realloc_sum_counter) eax");
> //
> //
> //         FlushOutAsm("\n  push %d ", size);
> //         FlushOutAsm("\n   push __reallocked_str_label");
> //         FlushOutAsm("\n    call (\"msvcrt.dll\"->printf)");
> //         FlushOutAsm("\n     pop edx ");
> //         FlushOutAsm("\n      pop edx ");
>      }
> 
> }

Sick, totally sick !

> instead of insane bulshit of c++ containers?

They're much easier to handle.

You don't trust into abstractions and you would be overburdened with
a language like C++ or Rust. These abstractions that do the same thing
you do manually in C. Instread you want to flip every bit yourself in
C. This leads to more and less readable code.
Technical Details
Message-ID: <11e90j7$io87$1@raubtier-asyl.eternal-september.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
References: <11dup6q$v4j9$1@dont-email.me> <11e0kde$1jpvu$1@dont-email.me> <11e0r13$1lqm6$1@dont-email.me> <11e0uc0$1mtpv$1@raubtier-asyl.eternal-september.org> <11e7fj4$37l9$1@dont-email.me> <11e8oro$ft4l$1@raubtier-asyl.eternal-september.org> <11e8stp$hajr$1@dont-email.me> <11e8ti0$hhqa$1@dont-email.me> <11e8v24$i2mc$2@raubtier-asyl.eternal-september.org> <11e9045$ihk3$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita Montero <Bonita.Montero@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: C and its pesent 'ancestos'
Date: Thu, 26 Nov 2026 11:10:47 +0100
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <11e90j7$io87$1@raubtier-asyl.eternal-september.org>
References: <11dup6q$v4j9$1@dont-email.me> <11e0kde$1jpvu$1@dont-email.me>
 <11e0r13$1lqm6$1@dont-email.me>
 <11e0uc0$1mtpv$1@raubtier-asyl.eternal-september.org>
 <11e7fj4$37l9$1@dont-email.me>
 <11e8oro$ft4l$1@raubtier-asyl.eternal-september.org>
 <11e8stp$hajr$1@dont-email.me> <11e8ti0$hhqa$1@dont-email.me>
 <11e8v24$i2mc$2@raubtier-asyl.eternal-september.org>
 <11e9045$ihk3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 26 Nov 2026 10:10:47 +0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org;
	logging-data="614663"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18FCezX4TwbKmQPMbkExEYw3StBVSstFR0="; posting-host="b5d0c6a64d4561e46edbb7a5c64af4ef"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qqeQrLxNsu4Yl3OBo3p0RS0491g= sha256:x3G2AKmLNziFsC75KOa+X8QdVW6hg/SVVmUXaB7bTNU=
	sha1:KqfBre3dPCfVcjQa72xJgmg869Y= sha256:6+Y6Y3CXmyR03iPNV4UmmvbP4tDTIAPh3by5GQBu7Fw=
In-Reply-To: <11e9045$ihk3$1@dont-email.me>
Content-Language: de-DE