Skip to content

Instantly share code, notes, and snippets.

@tloriato
Created June 28, 2018 02:45
Show Gist options
  • Save tloriato/c0c4be8857b1ccd565065dc42f12662d to your computer and use it in GitHub Desktop.
Save tloriato/c0c4be8857b1ccd565065dc42f12662d to your computer and use it in GitHub Desktop.
int fullSize = stringlenInt + dirnamelenInt + 1;
char * fullPath = malloc(sizeof(char) * (fullSize) + 4);
memset(fullPath, 0, fullSize);
memcpy(fullPath, stringPath, stringlenInt);
fullPath[stringlenInt] = '/';
memcpy(fullPath + stringlenInt + 1, dirname, dirnamelenInt);
strcat(fullPath,"/a.a");
fullPath[fullSize + 4] = '\0';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment