TP7: formattage
This commit is contained in:
12
TP7/getio.h
12
TP7/getio.h
@@ -1,9 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
void getfloat(ifstream& s, float& f, const char sep);
|
||||
void getint(ifstream& s, int& f, const char sep);
|
||||
|
||||
template <class T>
|
||||
void format(T t, int w) {
|
||||
cout << left << setw(w) << t << " ";
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void format(T t) {
|
||||
format(t, 4);
|
||||
}
|
||||
Reference in New Issue
Block a user