If I were to enter a name with first name, middle initial, and last name, how would I get it to display just the first name using members of <cstring>?
// Display First Name.cpp : main project file.
#include <iostream>
#include <cstring>
usingnamespace std;
int main()
{
char name[50];
cout << "Enter your full name: ";
cin.getline (name, 50);
cout << "Your name's length is: " << strlen (name) << endl;
cout << "Your first name is : "; // Moved it here so name printed would not be all caps
for(int i=0;i<strlen (name);i++)
if(name[i]!=' ')
cout << name[i];
elsebreak;
cout << endl;
strlwr(name);
cout << "Your name in lower case: "<< name << endl;
strupr(name);
cout << "Your name in upper case: " << name << endl;
system ("pause");
return 0;
}