scanf is not suitable for this task
it stops when it sees a space or enter
use gets or fgets
for the count problem there is a command--->strlen
Code:
#include<stdio.h>
#define LEGAL 1
#include <string.h>
void count(char array[]);
int main(){
char line[100];
printf("Hey user enter some lines : ");
gets(line);
count(line);
getchar();
return(0);
}
/* FUNCTION count */
void count(char array[]){
int z=strlen(array);
printf("%d\n",z);
}