Untitled

I am trying to calculate leading spaces in string upto first alphabet character in line. Multiple lines are stored in 2d arrays.
mail@pastecode.io avatar
unknown
plain_text
4 years ago
665 B
2
Indexable
Never
#include <stdlib.h>
#include <string.h>
#include<stdio.h>
#include<conio.h>
int main()
{
 char name[100][30];
 int i,n,j,scount;
 char ch[30];
 int arr[10];
 int k=0;
 scount=0,j=0;
 printf("\nEnter The no. Lines : ");
 scanf("%d",&n);
 for(i=0;i<n;i++)
 scanf(" %[^\n]%*c",name[i]);   // storing multiple line on 2d array
 for(i=0;i<n;i++)
 {
 	strcpy(ch,name[i]);  //copying string to temporary char array ch.
 	printf("%s\n",ch);
 	for(j=0;ch[j]!=0;j++) //this is space count logic upto first alphabet character comes
 	{
        if(ch[j]=32)   // ascii of space
	  	  scount++;
	}
	printf("\n%d",scount);
    scount=0;
 	//printf("\n%s",name[i]);
 }
 getch();
}