The task is to write a program, the user enters a line, at the output the program shows how many words in the line begin with the letter "t", the counter does not work, does not output anything. Tell me, please, where I made a mistake.
#include <iostream> #include <string.h> using namespace std; int main() { int c=0; char a[100] = {0}; cout << "Vvedite stroky: "; cin.getline(a,100); if (a[100] == 't') { c++; for (int i = 0; i < strlen(a); i++) { if ((a[i] = ' ') && (a[i + 1] == 't')) { c++; } } cout << c; } system("pause"); return 0; }