diff options
| author | ven <vendethiel@hotmail.fr> | 2015-10-15 09:09:40 +0200 | 
|---|---|---|
| committer | ven <vendethiel@hotmail.fr> | 2015-10-15 09:09:40 +0200 | 
| commit | adc81a0bc55e5a32e455c773fe3949b4c7af83f9 (patch) | |
| tree | 67490c1c7133f823f3ceb88831581eb8b4cd286d | |
| parent | 51c506712ede8b3c4c18ea74ec19c6e97ce9e726 (diff) | |
| parent | 328ceb1a94f0fc6736e001ad0e7b6646173ca207 (diff) | |
Merge pull request #1480 from eltonvs/master
Translation fixes and extra information
| -rw-r--r-- | c.html.markdown | 4 | ||||
| -rw-r--r-- | pt-br/c-pt.html.markdown | 19 | 
2 files changed, 14 insertions, 9 deletions
| diff --git a/c.html.markdown b/c.html.markdown index 3339032f..fb77ca50 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -232,7 +232,7 @@ int main (int argc, char** argv)    0 || 1; // => 1 (Logical or)    0 || 0; // => 0 -  // Conditional expression ( ? : ) +  // Conditional ternary expression ( ? : )    int e = 5;    int f = 10;    int z; @@ -302,6 +302,8 @@ int main (int argc, char** argv)    for (i = 0; i <= 5; i++) {      ; // use semicolon to act as the body (null statement)    } +  // Or +  for (i = 0; i <= 5; i++);    // branching with multiple choices: switch()    switch (a) { diff --git a/pt-br/c-pt.html.markdown b/pt-br/c-pt.html.markdown index 451df4f3..43688724 100644 --- a/pt-br/c-pt.html.markdown +++ b/pt-br/c-pt.html.markdown @@ -6,6 +6,7 @@ contributors:      - ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"]  translators:      - ["João Farias", "https://github.com/JoaoGFarias"] +    - ["Elton Viana", "https://github.com/eltonvs"]  lang: pt-br  filename: c-pt.el  --- @@ -139,13 +140,13 @@ int main() {      int var_length_array[size]; // declara o VLA      printf("sizeof array = %zu\n", sizeof var_length_array); -	//Uma possível saída para esse programa seria: -    // > Entre o tamanho do array:: 10 +    // Uma possível saída para esse programa seria: +    // > Entre o tamanho do array: 10      // > sizeof array = 40  	// String são apenas arrays de caracteres terminados por um  -	// byte NUL (0x00), representado em string pelo caracter especial '\0'. -	// (Não precisamos incluir o byte NUL em literais de string; o compilador +	// byte nulo (0x00), representado em string pelo caracter especial '\0'. +	// (Não precisamos incluir o byte nulo em literais de string; o compilador  	// o insere ao final do array para nós.)      char uma_string[20] = "Isto é uma string";   	// Observe que 'é' não está na tabela ASCII @@ -153,8 +154,8 @@ int main() {  	// Porém, comentários podem conter acentos       printf("%s\n", uma_string); // %s formata a string -    printf("%d\n", uma_string[16]); // => 0 -    // i.e., byte #17 é 0 (assim como 18, 19, e 20) +    printf("%d\n", uma_string[17]); // => 0 +    // i.e., byte #18 é 0 (assim como o 19°, 20°, 21°...)  	// Se temos caracteres entre aspas simples, temos um caracter literal.  	// Seu tipo é `int`, *não* `char` (por razões históricas). @@ -220,11 +221,11 @@ int main() {      0 || 1; // => 1 (Ou lógico)      0 || 0; // => 0 -    //Expressão condicional ( ? : ) +    //Expressão condicional ternária ( ? : )      int a = 5;      int b = 10;      int z; -    z = (a > b) ? a : b; // => 10 "se a > b retorne a, senão retorne b."  +    z = (a > b) ? a : b; // => 10 "se a > b retorne a, senão retorne b."      //Operadores de incremento e decremento:      char *s = "iLoveC"; @@ -290,6 +291,8 @@ int main() {      for (i = 0; i <= 5; i++) {          ; // Use ponto e vírgula para agir como um corpo (declaração nula)      } +    // Ou +    for (i = 0; i <= 5; i++);  	// Criando branchs com escolhas múltiplas: switch()      switch (alguma_expressao_integral) { | 
