sprintf in VB

what would the replacement  for format data command in C such as spirntf.
eg) sprintf((tmpstr, "%02%02", x,y)
code will help.
Thank you
platiumstarAsked:
Who is Participating?
 
RentRightConnect With a Mentor Commented:
sprintf will yield 5 bytes because strings in C are null terminated. I did not know you wanted the null terminator.  If you do change it to
Format$(x, "00") & Format$(y, "00") & chr(0)
0
 
RentRightCommented:
Format$(x, "00") & Format$(y, "00")
0
 
platiumstarAuthor Commented:
your answer is close, but I think there is a slight difference between these, the number of bytes allocated is different.
unless I'm totally confused about how these commands work.

thanks
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
bruncheyCommented:
what does sprintf do in C?  does this just print a line of text
0
 
bruncheyCommented:
what does sprintf do in C?  does this just print a line of text
0
 
platiumstarAuthor Commented:
thanks for the answer.
for brunchey:

sprintf() format stuff into a string, you can pack anything, numbers, characters, ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.