c - Strange characters at the end of string -
i want fill string '_' have
while (i < length) { myword[i] = 95; i++; }
length const int typed user. when type printf("%s",myword);
it's output '____#s' or '____#' or it's output good.
where problem? thank :)
a string must end \0 char
while (i < length) { myword[i] = 95; i++; } myworkd[i] = 0;
Comments
Post a Comment