Link to home
Start Free TrialLog in
Avatar of capoeira
capoeira

asked on

padding with nulls

I need a routine that will take a char variable of size [20] & will pad the variable with NULLs for the remainder. for example if the variable is only 3 letters then the remaining  17 will be NULLs etc.
ASKER CERTIFIED SOLUTION
Avatar of hbadr
hbadr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
#include <string.h>
strncpy(variable,"ABC",20);