ok i wanted to enter a surname that can only fits 20 character...
but if some one enters more then 20 character, it would just read the first 20 character that is written, when it is printed out...but the character after the 20th one, will not be written anywhere and as a matter of fact, i don't want it to affect the rest of the program...
this is what i have so far...
Code:
#include <stdio.h>
int main(int argc, char ** argv)
{
// Mainline Variable Declarations
FILE * output = stdout;
FILE * input = stdin;
char * LName[20];
{
//Enter last name
fprintf(output,"--------------------------\n"); fflush(output);
fprintf(output,"Enter Your last name(maximum of 20 letters): "); fflush(output);
//input last name
fscanf(input,"%20s%*c",&LName);fflush(output);
}
//output
fprintf(output," %s",LName);