Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/concatenar.c Secret

Created Jan 13, 2021
Embed
What would you like to do?
// Nota: la cadena debería tener espacio suficiente para concatenar el carácter.
// Esta función no se encarga de evitar desbordamientos o cosas parecidas
// https://parzibyte.me/blog
void concatenarCharACadena(char c, char *cadena)
{
char cadenaTemporal[2];
cadenaTemporal[0] = c;
cadenaTemporal[1] = '\0';
strcat(cadena, cadenaTemporal);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment