I have created a console application and declared a string a and assigning in code I am getting error.
namespace ConsoleApplication1
{
class Program
{
string a;
static void Main(string[] args)
{
Console.WriteLine("Hello!");
}
}
}
Loading
Kirtan PatelPosted Nov 18, 2009, 7:37 PM
Just Modify Your Code like Below and it will work fine :)
class Program
{
static string a="Hello";
static void Main(string[] args)
{
Console.WriteLine(a);
}
}
check "Do you like this answer check box " if it helps you :)
jingePosted Nov 18, 2009, 7:23 PM
Sam HobbsPosted Nov 18, 2009, 5:49 PM
This applies to member functions for console programs also.