-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (40 loc) · 713 Bytes
/
main.cpp
File metadata and controls
51 lines (40 loc) · 713 Bytes
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
44
45
46
47
48
49
50
51
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream out("test.txt");
out<<"Hola mundo";
out<<1234;
out<<3.5;
out<<5.2f;
out<<true;
out<<"Hola mundo";
out.put('t');
out.put(65); //solo un char con un put
out.close();
ifstream in("test.txt");
string str;
int a;
double b;
float c;
bool d;
char e;
string f;
in>>a;
in>>b;
in>>c;
in>>d;
in>>e;
in>>f;
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
cout<<d<<endl;
cout<<e<<endl;
cout<<f<<endl;
//in>>str; //la siguiente linea hace los mismo que estao
//getLine(in,str);
cout<<str;
return 0;
}