fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5. int ascii, i;
  6. char texto[] = "Bom dia\nGood Moring\nBonjour";
  7.  
  8. printf("%s\n------------\n", texto);
  9.  
  10. for(i=0; texto[i]; i++) {
  11. ascii = (int)texto[i];
  12.  
  13. //if (ascii == 10) {
  14. if(texto[i] == '\n') {
  15. printf("Quebra de linha\n");
  16. } else {
  17. printf("%c = %d\n",texto[i],ascii);
  18. }
  19. }
  20. }
Success #stdin #stdout 0s 4796KB
stdin
Standard input is empty
stdout
Bom dia
Good Moring
Bonjour
------------
B = 66
o = 111
m = 109
  = 32
d = 100
i = 105
a = 97
Quebra de linha
G = 71
o = 111
o = 111
d = 100
  = 32
M = 77
o = 111
r = 114
i = 105
n = 110
g = 103
Quebra de linha
B = 66
o = 111
n = 110
j = 106
o = 111
u = 117
r = 114