Raised This Month: $ Target: $400
 0% 

Get sizeof array in a macro


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shauli
Member
Join Date: Jun 2018
Old 06-13-2018 , 05:24   Re: Get sizeof array in a macro
Reply With Quote #1

Quote:
Originally Posted by ^SmileY View Post
you can check sizeof array into _calculateArray stock, why you need to pass it?

also what you need to do with new array[4][6]; exactly?
This stock is inside my include file which I use in many different plugins that are not related to one another. Just a custom-made include.

When I try to use sizeof inside the stock (in the include file) I get this error:
Code:
WARNING [25]: indeterminate array size in "sizeof" expression (symbol "")
About the "array[4][6]" that is just an example. Here's another example that will make more sense:
PHP Code:
new values[MAX_PLAYERS+1][4];
//code......

public someStuff(id)
{
    
calculateArray(values[id], 2);
    
client_print(idprint_chat"%d"values[id][0]);

The purpose of the stock is to allow me to shuffle and "shift" indexes for the array, but that doesn't really matter because I have more stocks like this. Just wanted to know how can I use sizeof inside the stock.

Thank you for your answer!
shauli is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode