Jump to content
  • 0

Array Adding


Eternity9

Question

5 answers to this question

Recommended Posts

  • 0
Chiar acum, Banditul a spus:

new array[10];

array[4] = 4;

Asa introduci o valoare integer la o anunita pozitie din array(cazu de fata index 4 pozitia 5)

 

pai da, si daca vreau sa le pun pe toate trebuie sa pun de la array[0] pana la array[10], eu am nevoie intr-un singur cuvant, spre exemplu: new array = ( {"0"}, {"1"} };, sa pun doar 'array'

Link to comment
Share on other sites

  • 0

foloseste un for(...

depinde ce vrei tu de fapt sa faci

Citat
Link to comment
Share on other sites

  • 0
new array[10] = {0, 1, 2, 3};

Asta daca vrei sa instantiezi array-u direct cu valori date

new array[10];
for(new i = 0; i < sizeof(array); i++)
   array[i] = numar;

Daca vrei cu for

Intrebarea e, ce vrei mai exact sa faca array sau cum vrei sa folosesti. Pentru ca totu depinde de context

Edit: Daca vrei gen o functie AddToArray va trebui sa iti implementezi singur algoritmul. Pawn nu e atat de avansat incat sa ofere metode prin care sa lucrezi mai usor cu array

Edited by Banditul
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.