links rechts zentriert??



  • hi wie kann ich solche formatierungen vornehmen im std??? ohne std war es ja setiosflags(left)

    mfg dohan.



  • #include <iostream> 
    #include <iomanip> 
    using namespace std;
    
    int main() 
    { 
       cout.setf(ios::left, ios::adjustfield); 
        cout.width(16); 
        cout << "a" << endl; 
        cout.width(16); 
        cout << "b" << endl; 
        cout.width(16); 
        cout << "c" << endl; 
    
        cout.setf(ios::right, ios::adjustfield); 
        cout.width(16); 
        cout << "a" << endl; 
        cout.width(16); 
        cout << "b" << endl; 
        cout.width(16); 
        cout << "c" << endl;
    }
    

Anmelden zum Antworten