C++ question

Discussion in 'OT Technology' started by GuiltySparc, Apr 22, 2004.

  1. GuiltySparc

    GuiltySparc OT Supporter

    Joined:
    Apr 14, 2004
    Messages:
    12,070
    Likes Received:
    0
    Location:
    Maryland
    trying to write a program but forgot how to set feild width and precision...can some post the syntax real quick? i know theres a fixed in there and a setprecsion or something too...thanks

    Nathan
     
  2. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    cout << setw(n) << setprecision(n);
     
  3. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,250
    Likes Received:
    538
    you can also do this:
    cout.setf(xxx);
    where xxx is an ios::value
     

Share This Page