strlen issue
#1

I'm trying to do something like,
pawn Код:
new chars[strlen(string)];
But it doesn't work, is there any other way to create an array using a length of another string?
Reply
#2

Just put the size there.. I don't really see the point in doing what you are doing.
Reply
#3

new chars [your amount];
Reply
#4

array size must be indexed aka you need to give a size to chars array, strlen(string) will never work, you need a static value, such as new chars[32]; there is no such thing as dynamic arrays, at least in pawn.
Reply
#5

What you are looking for is y_malloc, it allocates a part of the stack and you can manage it with it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)