fork download
  1.  
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. void PrintStuff( char to_print, int length ) {
  7.  
  8. if( length > 127 ) length = 127; // clip to max buffer size
  9. char buffer[128];
  10.  
  11. // fill buffer with desired character
  12. memset( buffer, to_print, length );
  13.  
  14. // add null terminator
  15. buffer[length] = 0;
  16.  
  17. // print to output
  18. puts( buffer );
  19. }
  20.  
  21. int main() {
  22. PrintStuff( '=', 11 );
  23. return 0;
  24. }
  25.  
  26.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
===========