Get sizeof array in a macro
Hello all.
I've made the following code, which is in my include: PHP Code:
My problem is that it works fine when I use it like this: PHP Code:
PHP Code:
Code:
WARNING [273]: expression has no effect Thanks in advance. |
Re: Get sizeof array in a macro
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? |
Re: Get sizeof array in a macro
Quote:
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 "") PHP Code:
Thank you for your answer! :) |
Re: Get sizeof array in a macro
Trying again. Does someone has an easy solution?
|
Re: Get sizeof array in a macro
#define calculateArray2D(%1,%2,%3) _calculateArray2D(%1,%2,sizeof %3)
stock _calculateArray2D(array[][], num, size) { //some unimportant stuff here } Example >> calculateArray2D(2Darray[0], 2, 2Darray[]) Am not sure what are you trying to do it really depends on it. |
Re: Get sizeof array in a macro
Quote:
Since you can't directly use 'sizeof' (gives error) I tried to it with a macro. It works fine, but only when I use 1 dimensional arrays. |
All times are GMT -4. The time now is 01:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.