Problem mit den manipulatoren
-
QQ es will nicht funktionieren ...
vector<char>var(40); vector<char>var2(40); ifstream f ( "test.txt"); ifstream f2 ("test2.txt"); ofstream file ("final.txt"); while( f.getline(&var[0],40) && f2.getline(&var2[0],40) ) { file << &var[0]<< setw(15) << &var2[0] << "\n"; }Inhalt von test.txt
name
nachnameInhalt von test2.txt
abcdef
ghifinal.txt
name abcdef
nachname ghiIch will aber das die final.txt so aussieht:
name abcdef
nachname ghiWas mach ich da falsch?

-
#include <iostream> #include <iomanip> int main() { char vorname[]="Hans"; char nachname[]="Meier"; std::cout << std::left << std::setw(15) << "Vorname: " << vorname << '\n' << std::setw(15) << "Nachname: " << nachname << '\n'; }P.S.: std::string?