[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function strpadright - pad the right of a string
Syntax char *strpadright(char *str, char c, int len);
Prototype in stringhk.h
Remarks str will be padded on the right with len characters
of c. Make sure space allocated for str is big
enough to hold the new padded string.
Return value returns a pointer to the storage location
containing the newly padded string.
See also strpadleft()
Example #include <stringhk.h>
main()
{
char temp[30];
strcpy(temp,"This is a sample.");
printf("Before: %s\n",temp);
printf(" After: %s\n",
strpadright(temp,'?',3));
}
Program output Before: This is a sample.
After: This is a sample.???
See Also:
strpadleft()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson