Vector/array
Hi, my problem is simple. I want to have a vector called v and i want it to be [10] long and in it i want to store strings. I want to be able to add a string at a special place and i want to be able to delete a string at a place, also, i want to add data in the vector in the first empty place.
Now, my question is: How do i do that and should i use an array instead? If yes, how do i do that. Ive looked at http://www.amxmodx.org/funcwiki.php?go=inc&id=53 but im still not sure. Is there another site with more info on arrays/vectors or does someone just know how to do this? |
Re: Vector/array
|
Re: Vector/array
If only PAWN had pointers....
|
Re: Vector/array
Quote:
|
Re: Vector/array
Ok, so what i got from that is that u cant have an array of strings in an array. You can just have an array of chars that make a string? how the hell do you do when u want to have an array of strings then? Ive been searching for an article about vectors but with no luck. Are vectors the answer?
|
Re: Vector/array
Quote:
|
Re: Vector/array
Quote:
Code:
new array_1d[64] |
Re: Vector/array
Um, I am not sure if I exactly understand you but here is an array of strings:
Code:
|
Re: Vector/array
Quote:
PHP Code:
|
Re: Vector/array
no, you cant delcare any varriable with an empty array "[]" without initializing it. Because you will get a compile error. The only reason "[]" exsists it tell the compiler to determine the required length for the string so you dont have to type it in, which it can only do if you have the string you want it to analyze there at the time.
fix: Code:
So do this instead: Code:
|
| All times are GMT -4. The time now is 21:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.