Jeb
✅ HELP
I recentyl started to experiment a bit with C# and I ran into an error in my code please help. Im using visual studio 2019 btw. Error is "Cannot implicitly conver string to bool". Thanks.
------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace c_sharp
{
class Program
{
static void Main(string[] args)
{
Console.Title = "Yi Lan Ma";
Console.WriteLine("Hai everyvan aj em Yi Lan Ma.");
Console.WriteLine("Du ju want to buy a nukler wepon?");
string Response = Console.ReadLine();
if (Response = "Yes") { Console.WriteLine("Perfekt, Zat vil be 69 dolars."); } Console.ReadKey(); } } }
--------------- string Response = Console.ReadLine();
These two lines are causing the error. if (Response = "Yes")
if (Response = "Yes") { Console.WriteLine("Perfekt, Zat vil be 69 dolars."); } Console.ReadKey(); } } }
--------------- string Response = Console.ReadLine();
These two lines are causing the error. if (Response = "Yes")
8 replies