Passing a string in function
PHP Code:
Code:
D:\...\custom_stocks.inc(549) : error 035: argument type mismatch (argument 1) |
Re: Passing a string in function
Pass the string size as a param.
|
Re: Passing a string in function
?
Code:
|
Re: Passing a string in function
Quote:
PHP Code:
Quote:
|
Re: Passing a string in function
team[] => team[16]
|
Re: Passing a string in function
Quote:
PHP Code:
PHP Code:
|
Re: Passing a string in function
Quote:
And second code don't help me, because I need the string to use directly. And yes i can check with if and apply to string, but i wan't to know what's not good with mine code. |
Re: Passing a string in function
The destination buffer needs to have a size if I'm not mistaking. I'm on my phone and can test it right now, but I'm pretty sure I had the same problem once and fixed it like that. Try it. I'm 99% sure that's the problem.
//edit: lol, I just noticed... The "team" string in the function header has the same name with the "team" integer down below, so you're basically using "copy" on an integer. This is why szTeam and iTeam style names should be used. |
Re: Passing a string in function
Yes the problem was not having to specify the string size in the parameter.
|
Re: Passing a string in function
It was one of the problems. Compiler does not know the size of team param(unless it's cleary specified in the header - team[32] or whatever) and will issue a warning:
Code:
warning 224: indeterminate array size in "sizeof" expression (symbol "") |
| All times are GMT -4. The time now is 18:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.