Forum » Programiranje » polje struktur
polje struktur
![](https://static.slo-tech.com/stili/avatar.gif)
Vesoljc ::
v c/c++?
struct moja_struktura
{
int a;
float b;
};
moja_struktura moje_polje_stotih_struktur[100];
struct moja_struktura
{
int a;
float b;
};
moja_struktura moje_polje_stotih_struktur[100];
Abnormal behavior of abnormal brain makes me normal...
![](https://static.slo-tech.com/stili/avatar_gray.gif)
user4683 ::
še s kazalci (dinamično polje):
moja_struktura* dinamicno_polje_stotih_struktur;
...
dinamicno_polje_stoti_struktur = new moja_struktura[100];
...
po uporabi je treba za sabo pocistit memory! ---> delete[] dinamicno_polje_stoti_struktur;
moja_struktura* dinamicno_polje_stotih_struktur;
...
dinamicno_polje_stoti_struktur = new moja_struktura[100];
...
po uporabi je treba za sabo pocistit memory! ---> delete[] dinamicno_polje_stoti_struktur;
![](https://static.slo-tech.com/stili/avatar.gif)
BigWhale ::
Ampak, ce pogledas malo bolje, res vzames pod drobnogled, je pa vse skupaj cel kup enk in nicel. ce uporabs kak calloc() so pa pretezno same nule... ;>
![](https://static.slo-tech.com/stili/avatar.gif)
Vesoljc ::
zato pa v c++ uporabiš konstruktor, ki ti nameče enke točno tja, kamor jih rabiš...
![;)](https://static.slo-tech.com/smeski/icon_wink.gif)
Abnormal behavior of abnormal brain makes me normal...
![](https://static.slo-tech.com/stili/avatar_gray.gif)
OwcA ::
Če se igraš v C++ potem uporabiš std::vector ali kako njegovo izpeljanko in se predajaš lenobi kar se tiče sportenga zaseganja pomnilnika in podobnih packarij.
![;)](https://static.slo-tech.com/smeski/icon_wink.gif)
Otroška radovednost - gonilo napredka.
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [C] Seznam s poljemOddelek: Programiranje | 2512 (1992) | aceton |
» | programiranje na srednji šoliOddelek: Šola | 3395 (2584) | i386 |
» | [Vsi jeziki / C++] preprost logičen problemOddelek: Programiranje | 1169 (1076) | win64 |
» | Programersko gradivo za začetnikeOddelek: Programiranje | 5962 (4657) | bmandl |
» | Programiranje v C++Oddelek: Programiranje | 2592 (1450) | krneki0001 |