AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein GNU C++ - wie Speicherfehler abfangen ?
Thema durchsuchen
Ansicht
Themen-Optionen

GNU C++ - wie Speicherfehler abfangen ?

Ein Thema von paule32.jk · begonnen am 13. Aug 2024 · letzter Beitrag vom 19. Aug 2024
 
Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
356 Beiträge
 
Delphi 11 Alexandria
 
#8

AW: GNU C++ - wie Speicherfehler abfangen ?

  Alt 14. Aug 2024, 18:52
@Kas Ob.

it seem so.
But like I can see, that QChar is a class, with members like "bool isDigit()".
And me, when I have understand you, it should possible for C++ to "delete foo;", too.
When "foo" is not a Pointer (also when a Pointer to the class TuFoo exists:

auto * fifi = new TuFoo();

then you can delete it without problems.

I the simmilar same way, you can do: auto * fifi = new int;
which give you a "global" fifi reference, that over life the calling stack (it will also
accessible outside).

So, it should not be a Problem, that I i "free" the allocated memory (under 64-Bit there are
8 Bytes).

An other thing is it, if you use class references or integer references in the local scope
(without allocating static memory with "new").
So, class TuFoo fifi;
will automatically clean/free, if the callee function reach the Epilog.
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:40 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz