Displaying content

Alright for some reason I cant get my program to dispaly everythign that is in the currect file just a single word keeps shoing up can someone tell me what I am doing wrong here. I just cant figer it out.

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
 #include <iostream>
#include <string>
#include <iomanip>
#include <fstream>

using namespace std;


string PassW;

int main()
{

	cout<<"hello and welcome please enter your username and password below"<< endl;
	fstream inout;
	string Uname;
	cout<< "Username: "; cin >> Uname;
	cout<< "Password: "; cin >> PassW;
	cout<< "thank you\n";
	inout.open(Uname);
	inout >> Uname;
	cout << Uname << endl;
	inout.close();
	cout<<"now logged in\n";
system("pause");

return 0;
}
closed account (EwCjE3v7)
Sorry what exactly is the problem. Works for me

http://s10.postimg.org/fppcdd949/Capture.png
It like in the folder I have "What a great day" but when I have it dispaly it the only thing I get is "What"
try
inout.open("Uname");
I mean it looks like it is nor reading the file as a string but as a char type instead but I want to have the program searrch for the file the user enteres is their a way to fix this factor.
Topic archived. No new replies allowed.