In my C program, I create a char array like char read_str[MAX_ALLOWED_BUFFER];
.
With this array, how can I trim the whitespace and newline characters from the left and right side of it.
This isn't a pointer, so I don't understand how to get rid of the trailing characters.
Can anyone help please?
char read_str[MAX_ALLOWED_BUFFER];
FILE *fp;
fp = fopen(argv[1],"r");
fgets(read_str, MAX_BUFFER, fp);
// how to trim read_str ?