fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char buf[8] = "A5A5A5A";
  5. int idx;
  6.  
  7. strcpy(buf, "1010");
  8. for(idx=0; idx<8-1; idx++) {
  9. if (buf[idx] != 0) {
  10. printf("%c", buf[idx]);
  11. } else {
  12. printf("_");
  13. }
  14. }
  15. printf("\n");
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
1010_5A