[ create a new paste ] login | about

Link: http://codepad.org/TLzrG6Hn    [ raw code | output | fork ]

C, pasted on Aug 1:
#include <inttypes.h>
#include <stdio.h>

struct Pessoa
{
    char    nome[32];
    char    rg[14]; // 13 caracteres + '\0'
    uint8_t idade;
};

int main(void)
{
    struct Pessoa p1 = {
        .nome  = "Fulano",
        .rg    = "00.000.000-00",
        .idade = 27,
    };

    printf(" Nome: %s\n", p1.nome);
    printf("   RG: %s\n", p1.rg);
    printf("Idade: %u\n", p1.idade);
return 0;
}


Output:
1
2
3
 Nome: Fulano
   RG: 00.000.000-00
Idade: 27


Create a new paste based on this one


Comments: