Gibt es eine Grenze?
-
int* p=new int(8); int** pp=&p; int*** ppp=&pp; int**** pppp=&ppp; int***** ppppp=&pppp;
nimmt das irgendwann ein ende? gibt es eine grenze?
-
nimmt das irgendwann ein ende? gibt es eine grenze?
dein stack?
-
OK, verstehe. Danke.
-
viel spaß beim ausprobieren!!
-
Hab ich heute sowieso nichts besseres zu tun... mal gucken, wie weit ich's schaffe.
-
hehe
-
Brieföffner schrieb:
nimmt das irgendwann ein ende? gibt es eine grenze?
Wie viel Arbeitsspeicher hast du denn? Jedes von den Dingern verbraucht 4 Byte!
-
ach das kann der compiler doch bestimmt wegoptimieren
-
Der Arbeitsspeicher tut hier nichts zur Sache. Es gibt aber einen (nicht normativen) Anhang B im C++-Standard, der ein Minimum von 256 vorschlägt:
2 The limits may constrain quantities that include those described below or others. The bracketed number following each quantity is recom- mended as the minimum for that quantity. However, these quantities are only guidelines and do not determine compliance. [...] --Pointer, array, and function declarators (in any combination) modi- fying an arithmetic, structure, union, or incomplete type in a dec- laration [256].
-
Habs in der Arbeit mal gestest - ok nur angetestet. gcc kommt mit 2mio * gut zurecht, nur die compilezeiten sind mir dann zu lang geworden und ich habe aufgehört...