my problem is quite simple;
with printf("%d %s",strlen(tmp[i]),tmp[i]);
im getting length_of_my_string+1
i.e if it reads "ls" from the file, it prints 3 instead of 2;
any solution?
The fgets() function reads at most one less than the number of characters
specified by size from the given stream and stores them in the string
str. Reading stops when a newline character is found, at end-of-file or
error. The newline, if any, is retained.
You are getting a newline character at the end of the line, and, it is retained. i.e. ls is stored as tmp[0][0]=l tmp[0][1]=s and tmp[0][2]='\n'