RE: int to string

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



> s = "Hello" + i;

The + operator returns a string.

> s = i;

You cannot (in general) assign an object of one type to an object of another
type.

Despite the visual simularity of the two cases, there is really no
comparision, and hence no contradiction.



"John Salerno" wrote:

> Given this:
>
> string s;
> int i = 0;
>
> why does this work:
>
> s = "Hello" + i;
>
> but this doesn't:
>
> s = i;
>
> Thanks.
>
.



Relevant Pages

  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
    (comp.programming)
  • RE: Controling Modal Dialogs (Solution)
    ... doesn't return until the 'modal' browser returns. ... string varOptions) ... public void DocumentComplete ... int rc = winDisp.Invoke(rgDispId, ref guid, 0, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Gcc compatible header file
    ... A string collection is a table of zero terminated strings that will grow ... typedef struct _StringCollection StringCollection; ... int; ... bool; ...
    (comp.lang.c)
  • Kernighan and Pikes "Beautiful" Code
    ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
    (comp.programming)
  • Re: FTP CD command
    ... public const int GENERIC_WRITE = 0x40000000; ... string lpszProxyName, ... public static extern IntPtr InternetConnect ( ... public static extern bool FtpGetCurrentDirectory ( ...
    (microsoft.public.dotnet.languages.vb)