Let's say I had an array of different names, and I wanted to check if the name started with a particular letter, which in this case is 'J'. How would I check for that? I wrote most of the source code (and created an array so that it'll print out inputted names that start w/ 'J' but I'm not entirely sure if I would just need a condition to check or not.
#include <iostream>
using namespace std;
int main()
{
string a[10];
string b[10];
int i=0, n=0, k=0;
cout<<"Enter the number of elements."<<endl;
cin>>n;
for(i=0;i<n;i++)
{
cout<<"\nA["<<i<<"]=";
cin>>a[i];
}