hi,
How do i print out the text such that the alignment is always there regardless of how long the name of person is...
From :
Code:
Records
----------
ID Name DateOfBirth Height Weight
01 jenny 21/01/81 1.68 45
To :
Records
----------
ID Name DateOfBirth Height Weight
01 jenny 21/01/81 1.68 45
my code is :
printf("ID \t Name \t DateOfBirth \t Height \t Weight\n");
printf("%d \t %s \t %d/%d/%d \t %-0.2f \t %-0.1f\n",HobbitsArray[i].hobbitID, HobbitsArray[i].name, HobbitsArray[i].dateOfBirth.day,HobbitsArray[i].dateOfBirth.month,HobbitsArray[i].dateOfBirth.year, HobbitsArray[i].height, HobbitsArray[i].weight);
i++;
}
CODE TAGS added by Hammer