SA-MP Forums Archive
What does %.*s do? - 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: What does %.*s do? (/showthread.php?tid=565458)



What does %.*s do? - NexTioN1230 - 27.02.2015

Hello People,
What does the %.*s do? Some told me to use it when i need to make a text that if it will be more than 80 words it will create a second line with the second half of what the person wrote....
But what does the %.*s do?
Thanks for helping and have a good day!


Re: What does %.*s do? - 1fret - 27.02.2015

I don't clearly understand what you are saying but visit the link below
https://sampwiki.blast.hk/wiki/Format

Hope it help you


Respuesta: What does %.*s do? - CuervO - 27.02.2015

I randomly read this as I wanted to go to the 0.3.7 boards and thought "That would be the most awesome thing ever", but no, At least in C it's sort of an extra argument lenght limiter:

Quote:

It prints N number of characters from a target string :

printf("%.*s", 5, "=================");

will print =====

And following that reasoning it wold be the same as doing %.5s; it does not split anything and you need an extra function for that.