Displaying a variable in a msg box.

This is a discussion on Displaying a variable in a msg box. within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Bubba Either approach is valid whether it be via stringstream or via sprintf. Since this is a ...

  1. #31
    Registered User kakayoma's Avatar
    Join Date
    Jul 2009
    Location
    Dallas, Texas
    Posts
    42
    Quote Originally Posted by Bubba View Post
    Either approach is valid whether it be via stringstream or via sprintf. Since this is a C++ forum then naturally we would recommend the stringstream approach. However that does not make it more or less right in a purely technical sense. Both will accomplish the goal and both will get the job done. To me there is no benefit in using C++ just to be more C++-ey and in this instance it makes no difference either way. When I use a C++ approach to solve a problem it is for a very distinct reason and to serve a specific purpose. It is not merely to please the C++ gods whoever they may be or to look myself in the mirror in the morning and pride myself on being a C++ programmer.
    I completely agree.

    Vista - Something We all Love to Hate.

  2. #32
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,427
    Quote Originally Posted by Bubba View Post
    Either approach is valid whether it be via stringstream or via sprintf. Since this is a C++ forum then naturally we would recommend the stringstream approach. However that does not make it more or less right in a purely technical sense. Both will accomplish the goal and both will get the job done. To me there is no benefit in using C++ just to be more C++-ey and in this instance it makes no difference either way. When I use a C++ approach to solve a problem it is for a very distinct reason and to serve a specific purpose. It is not merely to please the C++ gods whoever they may be or to look myself in the mirror in the morning and pride myself on being a C++ programmer.
    This I know. But there can also be a bad reason behind using the C approach.
    So I want to make sure. Why is a C++ dev using C to get the job done? It's error prone and vulnerable to buffer overruns.
    If it's a valid reason, then code away.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. Virtual Box
    By ssharish2005 in forum Tech Board
    Replies: 3
    Last Post: 02-12-2009, 04:08 AM
  3. No data showing in combo box
    By PJYelton in forum Windows Programming
    Replies: 6
    Last Post: 04-29-2005, 07:20 PM
  4. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  5. Use of variable
    By alice in forum C Programming
    Replies: 8
    Last Post: 06-05-2004, 07:32 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21