fork(1) download
  1. #include <stdio.h>
  2. #define TAM 3
  3.  
  4. void preencher(char *str, char letra) {
  5. for (int c = 0; c < TAM - 1; c++) str[c] = letra;
  6. str[TAM - 1] = 0;
  7. printf("%s", str);
  8. }
  9.  
  10. int main(){
  11. char str[TAM], letra;
  12. scanf("%c", &letra);
  13. preencher(str, letra);
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/317828/101
Success #stdin #stdout 0s 4484KB
stdin
a
stdout
aa