#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
typedef struct {
char nome[ 50 ] ;
int conta;
int saldo;
} Cliente;
void cadastro_cliente( Cliente * cliente) {
printf ( "\n Insira o nome completo do titular da conta: " ) ; scanf ( "%49s" , cliente
-> nome
) ; printf ( "\n Insira o nĂºmero da conta: " ) ; scanf ( "%d" , & cliente
-> conta
) ; printf ( "\n Insira o saldo da conta: " ) ; scanf ( "%d" , & cliente
-> saldo
) ; }
int main( ) {
Cliente clientes[ 1000 ] = { { .nome = "" , .conta = 0 , .saldo = 0 } } ;
for ( int i = 0 ; i < 2 ; i++ ) cadastro_cliente( & clientes[ i] ) ;
for ( int i
= 0 ; i
< 2 ; i
++ ) printf ( "\n %s - %d" , clientes
[ i
] .
nome , clientes
[ i
] .
conta ) ; }
//https://pt.stackoverflow.com/q/257797/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPGxvY2FsZS5oPgoKdHlwZWRlZiBzdHJ1Y3QgewogICAgY2hhciBub21lWzUwXTsKICAgIGludCBjb250YTsKICAgIGludCBzYWxkbzsKfSBDbGllbnRlOwoKdm9pZCBjYWRhc3Ryb19jbGllbnRlKENsaWVudGUgKmNsaWVudGUpIHsKICAgIHByaW50ZigiXG5JbnNpcmEgbyBub21lIGNvbXBsZXRvIGRvIHRpdHVsYXIgZGEgY29udGE6ICIpOwogICAgc2NhbmYoIiU0OXMiLCBjbGllbnRlLT5ub21lKTsKICAgIHByaW50ZigiXG5JbnNpcmEgbyBuw7ptZXJvIGRhIGNvbnRhOiAiKTsKICAgIHNjYW5mKCIlZCIsICZjbGllbnRlLT5jb250YSk7CiAgICBwcmludGYoIlxuSW5zaXJhIG8gc2FsZG8gZGEgY29udGE6ICIpOwogICAgc2NhbmYoIiVkIiwgJmNsaWVudGUtPnNhbGRvKTsKfQoKaW50IG1haW4oKSB7CiAgICBzZXRsb2NhbGUoTENfQUxMLCIiKTsKICAgIENsaWVudGUgY2xpZW50ZXNbMTAwMF0gPSB7eyAubm9tZSA9ICIiLCAuY29udGEgPSAwLCAuc2FsZG8gPSAwIH19OwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyOyBpKyspIGNhZGFzdHJvX2NsaWVudGUoJmNsaWVudGVzW2ldKTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMjsgaSsrKSBwcmludGYoIlxuJXMgLSAlZCIsIGNsaWVudGVzW2ldLm5vbWUsIGNsaWVudGVzW2ldLmNvbnRhKTsKfQoKLy9odHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMjU3Nzk3LzEwMQ==