Dev C Setw

  

Basically the idea is to center a string. I selected the total length to equal 80. I know there is no fail safe placed into this program. I know there is another way to do this. I am stuck in a way. The program works, but I think I am doing it the hard way. any information or advice would be helpful.

Dev c setw in c

Jan 03, 2017  알고리즘 문제풀이를 하다보니 C의 경우는 STL: standard template library 이 존재하지 않아 스택을 직접 구현해야하는 어려움이 존재했습니다. Default precision (6): 3.14159 std::setprecision(10): 3.141592654 max precision: 3.89793239 See also. Fixed scientific hexfloat defaultfloat.

Thank you in advance.

  • 3 Contributors
  • forum 7 Replies
  • 4,615 Views
  • 3 Weeks Discussion Span
  • commentLatest Postby TimeFractalLatest Post

Nick Evan4,005

You could use setw() from <iomanip>

Here's how I would do it: (assuming your screenwidth of 80)

Dev C++ Download Windows 10

Setw

C++ Setw Meaning

note: not tested, I don't have a compiler at the moment. but you get the basic idea!