SA-MP Forums Archive
Is it bad to have sscanf warning: No default value found? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is it bad to have sscanf warning: No default value found? (/showthread.php?tid=436216)



Is it bad to have sscanf warning: No default value found? - Nostrum - 10.05.2013

Hello, i was wondering is it really bad to have "sscanf warning: No default value found"
I mean, can i ignore the warning and just carry on with everything else. How will the warning impact performance and so on?


Re: Is it bad to have sscanf warning: No default value found? - Basssiiie - 10.05.2013

I don't think it's deadly, but is it really that hard to give your optional parameters a default value?


Re: Is it bad to have sscanf warning: No default value found? - Kwarde - 10.05.2013

It is not really bad but it is annoying. As far as I know it's not that bad but I'm not sure about this!
To fix it:

For example, if you have sscanf(params, "dD", val1, val2)), you don't have the default value! To add a default value:
sscanf(params, "dD(1)", val1, val2)). Now this 'val2' will have default value 1!