Skip to content

Instantly share code, notes, and snippets.

Created June 2, 2011 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1004849 to your computer and use it in GitHub Desktop.
Save anonymous/1004849 to your computer and use it in GitHub Desktop.
Código para ler string
#include <stdio.h>
int main(int argc, char **argv)
{
/* uma string é um array de chars,
coloquei o número 50 supondo que
vc não vai colocar mais que 50
caracteres no buffer */
char nome[50];
printf("Entre com o seu nome"); //vai pedir um nome
gets(nomecompleto); //digite seu nome inteiro
printf("O nome é: %s", nomecompleto);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment