How to add characters to reach the maximum size of a char[].
- by Bon_chan
Hi folks,
I have the following part of code :
for(int i=0;i<n;i++)
{
printf("Student %d\n",i+1);
printf("Enter name : ");
scanf("%s",&(student+i)->name);
fflush(stdin);
lengthName = strlen((student+i)->name);
while(lengthName !='\0')
{
}}
when the length is shorter than 10, it will add hyphens…