Ansh Kathuria Posted January 31, 2022 Share Posted January 31, 2022 Hello there! Can anyone please explain me in detail what is "sprintf" and what is the use of that ? Also tell that why we use "%d" in the vex ? for example: s@name = sprintf("debris_f%d_%d", Frame, @ptnum); - Now what is the meaning of adding %d in this ? I tried to gather information from everywhere but not able to understand the basic usage of that. Anyone's help will be great for me. Thanks! Quote Link to comment Share on other sites More sharing options...
trex92 Posted January 31, 2022 Share Posted January 31, 2022 sprintf returns a string value instead of printing to the console. The "%d" can be thought of as placeholder for values to be inserted. So you could write: s@name = "debris_f" + itoa(@frame) + "_" + itoa(@ptnum); or s@name = debris_f%d_%d", Frame, @ptnum; Quote Link to comment Share on other sites More sharing options...
Ansh Kathuria Posted January 31, 2022 Author Share Posted January 31, 2022 Ohh i got it! trex92 Thank you so much bro. You made it so much easy, nice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.