test_struct2.htm
 
 
Stuct:: namespace: Use optional

To avoid any name conflicts

Code (incorrect Namespace : )

// Namespace Declaration
//File location : C:\BareBone_CSharp\Source_Code\Template
using System;
//csc test_struct2.cs
using System.Collections.Generic;
// Program start class
namespace testStruct2
{
struct Student{
public string name;
}
class CsharpTemplate
{
// Main begins program execution.
public static void Main(string[] str1)
{
testStruct1.Student student1 ;
testStruct1.Student student2 ;
Console.Write("Please eneter your name : " );
student1.name =Console.ReadLine();
Console.Write("Welcome ");
Console.WriteLine(student1.name);
student2 = student1;
Console.WriteLine(student2.name);

}
}
//
}

 
Correct namespace

Code Used :

// Namespace Declaration
//File location : C:\BareBone_CSharp\Source_Code\Template
using System;
//csc test_struct2.cs
using System.Collections.Generic;
// Program start class
namespace testStruct2
{
struct Student{
public string name;
}
class CsharpTemplate
{
// Main begins program execution.
public static void Main(string[] str1)
{
Student student1 ;
testStruct2.Student student2 ;
Console.Write("Please eneter your name : " );
student1.name =Console.ReadLine();
Console.Write("Welcome ");
Console.WriteLine(student1.name);
student2 = student1;
Console.WriteLine(student2.name);

}
}
//
}