aboutsummaryrefslogtreecommitdiff
path: root/mod_10a/source.cpp
blob: 32a1cece58ca079a6e1e2841a011eb0b99976be5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*Tyler Taormina
 *CST 116
 *
 */

#include "source.h"


void getName();
{
    char name[50];
    char lastname[50];
    char fullname[100]; // Big enough to hold both name and lastname
   
    cout<<"Please enter your name: ";
    cin.getline ( name, 50 );
    cout<<"Enter your last name: ";
    cin.getline ( lastname, 50 );
    fullname[0] = '\0';            // strcat searches for '\0' to cat after
    strcat ( fullname, name );     // Copy name into full name
    strcat ( fullname, " " );      // We want to separate the names by a space
    strcat ( fullname, lastname ); // Copy lastname onto the end of fullname
    cout<<"Your full name is "<< fullname <<"\n";
    cin.get();
}