Skip to content

Instantly share code, notes, and snippets.

@ivanelson
Created December 17, 2018 13:46
Show Gist options
  • Save ivanelson/d9a4e6c8d91cf6a7d895484f551393a3 to your computer and use it in GitHub Desktop.
Save ivanelson/d9a4e6c8d91cf6a7d895484f551393a3 to your computer and use it in GitHub Desktop.
Vetor de Caracteres (String)
#include <stdio.h>
int main() {
char str[] = "meu string"; /*reserva espaço para 11 caracteres*/
/* Vou alterar o caracter da sexta posição do vetor str[] */
str[5] = 'd';
printf("Ou seja troquei o t pelo d na frase: meu string -> %s ",str);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment