A Very Simple Language Related Question

Revision en1, by NeverSayNever, 2016-11-19 09:38:14

I want to write a function that accepts one string and one integer and return concatenation of both but i always want integer to be fixed width say 3.

e.g. if string is "jamesbond" and integer is 7, function should return a string "jamesbond007". How to do it in C++ ?

Note: I dont want to write if else and other conditional statements. Thank you.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English NeverSayNever 2016-11-19 09:38:14 397 Initial revision (published)