name from file to file

Please help i can't figure out the error and it is driving my insane
according to VS 2010 lines 27 & 29 but u can't figure it out please help
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// namegame.cpp : Defines the entry point for the console application.
/* Program that reads from names files and writes
to name files in a Lastname, Firstname format.
James M Snook III 10/10/12*/

#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>

using namespace std;

int main ()
{
	//variables
	ifstream lnamein;
	ifstream fnamein;
	ofstream nameout;
	string lastname;
	string firstname;
	string nameout;
	string pause;

	//Get input from files
	lnamein.open ("lastname.dat");					// contains a  last name
	lnamein.getline ("lastname.dat", lastname);
	fnamein.open ("firstname.data");				// contanins a first name
	fnamein.getline ("firstname.dat", firstname);
	nameout.open ("nameout.dat");					// will contain last name, firstname

	//output to screen
	cout << \n << lastname ;
	cout << \n << firstname ;
	nameout << lastname << ", " << firstname;

	//close files and pause screen before exiting
	lnamein.close();
	fnamein.close();
	nameout.close();
	cin.get ();
	return (0);
}
it is at the lastmame.get the "." is acting like an error
Topic archived. No new replies allowed.