Re: Building strings

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Well, you might use standard C code (suitably modified for Unicode strings):

TCHAR message[ 512 ];
_stprintf( message, _T( "Your Number: %d" ), i );
MessageBox( NULL, message, _T( "Caption" ), MB_OK );

You might be able to use a C++ string class to 'add up' your strings like
that old Pascal syntax, but there's no standard C way to do it.

Paul T.

"Safiiru no Baka" <wtfxxx@xxxxxxxxx> wrote in message
news:1137100448.796900.245620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi I've a quick question for my debugging:
>
> I need to output variables and such to MessageBox. Such as:
>
> int i = 34;
>
> MessageBox(NULL, L"Your Number: " + i, L"Caption, MB_OK);
>
> But of course that wont work. How do I go about it?
>


.



Relevant Pages

  • Re: Zero terminated strings
    ... I believe misinterpreted NUL termination is unique to the C language. ... the C99 Standard, ... just so they can have a warm fuzzy feeling about their strings. ...
    (comp.lang.c)
  • Re: Language lawyers: Was: Re: Paging the gfortran (64-bit Linux, medium memory model) mavens
    ... language lawyers -- is this line of code legal standard Fortran? ... F77 does not allow zero-length strings. ... distributions (or the standard CMS distributions, ...   write'' ...
    (comp.lang.fortran)
  • ANN: first draft of R7RS small language available
    ... The first draft of the R7RS small language standard is now ... String ports have been added as a way to write characters to ... and read characters from strings. ... Case now supports a => syntax analagous to cond. ...
    (comp.lang.scheme)
  • Re: Why no Ada.Wide_Directories?
    ... Not all possible file system features, even common ones, are abstracted ... The latter is a bug, because the file exists, is accessible ... Yet the standard doesn't ... character strings, then you are wrong. ...
    (comp.lang.ada)
  • Re: newbie question about string initialization
    ... This is almost certainly a variation in compiler "interpretation" of the ... standard, I'm not sure if it can be classified as a "bug" but certainly a ... functions that are "safe" versions that do a character by character check ... The design of F77 strings is extremely poor in a number of significant areas ...
    (comp.lang.fortran)