As per the image, you can see I have inserted whole lot of text but the total length by strlen is only showing 8 (k=8).
I wanted to print full text inserted into one string a line but it is stopping in 8th character.
`#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
int i;
char *s;
s = malloc(1024 * sizeof(char));
scanf("%[^\n]", s);
s = realloc(s, strlen(s) + 1);
int k=sizeof(strlen(s));
for(i=0;i<sizeof(strlen(s)+1);i++)
{
if(*(s+i)!=' ')
printf("%c",*(s+i));
else
printf("\n");
fflush(stdin);
}
free(s);
return 0;
}`