I try to understand this code but I don't know how this part work:
for (length = 0; t[length]; length++);
length--;
And specially I want to know how this for (length = 0; t[length]; length++);
work?! what does for(); mean? what does this ; (semicolon) mean that comes after for() in c code instead of {}?
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main() {
char t[] = "abcdefghijklmnopqrstuvwxyz", temp;
int i, length;
system("cls");
for (length = 0; t[length]; length++);
length--;
puts("the initial text is :");
puts(t);
for (i = 0; i < length / 2; i++) {
temp = t[i];
t[i] = t[length - i];
t[length - i] = temp;
}
puts("the reversd test is :");
puts(t);
getch();
return 0;
}
I pleased if someone help me and explain about that part of this code... what for(); mean??