So i'm trying to build a basic calculator in C# to test myself, and so far i have this code
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("1. Addition");
Console.WriteLine("2.Subtraction");
Console.WriteLine("3.Multiplication");
Console.WriteLine("4.Division");
string menuchoice = Console.ReadLine();
if (menuchoice = 1)
{
}
if (menuchoice = 2)
{
}
if (menuchoice = 3)
{
}
if (menuchoice = 4)
{
}
}
}
}However the problem i'm having is that i'm getting this error
"
Error 1 Cannot implicitly convert type 'int' to 'string' C:\Users\Matt\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs 18 30 ConsoleApplication1
"
What does it mean? And how should I go about fixing it.
Thanks in advanced!
~Matt