Code:
int main()
{
int sranje;
char polje[30];
int a,br=0,j=0;
printf("Unesi: ");
gets(polje);
for(a=0;a<strlen(polje)+1;a++)
{
if(polje[a]==' ')
{
br++;
if(br>10)
{
polje[j]=polje[a];
j++;
}
}
else
{
br=0;
polje[j]=polje[a];
j++;
}
}
puts(polje);
scanf("%d", &sranje);
}
First of all, I wrote some of this and I don't really understand what I wrote. The thing is, I'm trying to remove spaces in the string. With this I managed to remove them by using , which I added, but what I dont get is this part
Code:
else
{
br=0;
polje[j]=polje[a];
j++;
}
so, if someone can explain this to me, I really need to understand this.