Crystal Space
Welcome, Guest. Please login or register.
July 30, 2014, 06:26:10 pm

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8260 Members
Latest Member: Lovelymae39
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Arrays
« previous next »
Pages: [1] Print
Author Topic: Arrays  (Read 2094 times)
Sander
Guest


Email
« on: August 07, 2005, 03:46:41 pm »

How exactly do i use a csArray<>? There is perfect documentation about initializing an array and getting items from it, but I can't figure out how to add a new item to a csArray. Any help appreciated.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: August 07, 2005, 05:03:45 pm »

How exactly do i use a csArray<>? There is perfect documentation about initializing an array and getting items from it, but I can't figure out how to add a new item to a csArray. Any help appreciated.

csArray<int> a;

a.Push (3);
a.Push (2);

Greetings,
Logged
Sander
Guest


Email
« Reply #2 on: August 08, 2005, 01:58:00 pm »

Thanks jorrit.

Just to make sure:

with a.Push(3) are you adding an item with value 3? or are you setting the number of items in the array to 3?

Thanks.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: August 08, 2005, 02:00:15 pm »

Thanks jorrit.

Just to make sure:

with a.Push(3) are you adding an item with value 3? or are you setting the number of items in the array to 3?

Thanks.

Ok, perhaps a bad example. It will simply add the '3' at the end of the array.

Greetings,
Logged
Sander
Guest


Email
« Reply #4 on: August 08, 2005, 04:58:27 pm »

OK, thanks
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.183 seconds with 16 queries.