CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Jim_Auricman

Search: Search took 0.13 seconds.

  1. Re: Cannot implicitly convert type "string" to "int"

    You have guess defined as an int, but Console.ReadLine() returns a string. That is the mismatch. That's why I gave you this line:
    string guess_str = Console.ReadLine();
    Then you can convert it to...
  2. Re: Cannot implicitly convert type "string" to "int"

    BioPhysEngr, I agree that using "goto" is a bad practice. But why do modern languages, including C#, allow its usage? It is an unnecessary statement so it shouldn't be included in the language.
  3. Re: Cannot implicitly convert type "string" to "int"

    The guess string must be converted to an int before the comparison takes place.
    Here are a few hints:


    guess_str = Console.ReadLine();
    guess_str =...
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured