fork download
  1. #include <iostream>
  2.  
  3. char * test( int number, char * ret )
  4. {
  5. sprintf( ret, "%03d", number );
  6. return ret;
  7. }
  8.  
  9. int main()
  10. {
  11. char str[4];
  12. printf( "%s", test( 12, str ) );
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
012