Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Object reference not set to an instance of an object error c#

$
0
0
Hi Expert,

I am a beginner in visual c#, i have a problem while running this code string

Code:

namespace sampleprocess
{
    public partial class main : Form
    {
        public main()
        {
            InitializeComponent();

        }

        private string[] betPosCol;

private unsafe void setArrays()
{

        betPosCol[1] = "Red";
        betPosCol[2] = "Black";
        betPosCol[3] = "Red";
        betPosCol[4] = "Black";
        betPosCol[5] = "Red";
}
}
}

the troubleshooter said that : use "new" keyword to create an object instance

Please help me what is wrong with my code

Regards,

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>