fork(2) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char ch[12];
  6. strcpy(ch, "abc");
  7. printf("ch tem %lu bytes\n", sizeof(ch));
  8. printf("ch conta com %lu caracteres\n", strlen(ch));
  9. strcpy(ch, "texto longo");
  10. printf("ch conta com %lu caracteres\n", strlen(ch));
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/155932/101
Success #stdin #stdout 0s 4160KB
stdin
Standard input is empty
stdout
ch tem 12 bytes
ch conta com 3 caracteres
ch conta com 11 caracteres