C/Estrutura e estilo: Diferenzas entre revisións

Contido eliminado Contido engadido
Gallaecio (conversa | contribucións)
Gallaecio (conversa | contribucións)
m →‎Liñas baleiras: Empezo a traducir
Liña 39:
 
===Liñas baleiras===
As liñas baleiras deberías de usalas en tres partes fundamentais do teu código:
Blank lines should be used in three main parts of your code
*Tras declaracións de precompilación.
*After precompiler declarations.
*Despois de declarar as novas variables.
*After new variables are declared.
*Entre novos camiños de código (por exemplo, declaracións de funcións ou bucles, ou tras o peche de chave "}").
*Between new paths of code. (i.e. Before the declaration of the function or loop, and after the closing '}' bracket).
 
10 #include <stdio.h>
''Note that we have added line numbers to the start of the lines. Using these in actual code will make your compiler fail, they are only there for reference in this book.''
int main(void)
 
{
10 #include <stdio.h>
20 int main(void)i=0;
50 printf("Hello, World!");
30 {
40 intfor (i=0; i<1; i++)
{
50 printf("Hello, World!");
60 for (i=0; i<1; i++)
70 {
80 printf("\n");
90 break;