Hi all,
I want to define some this:
int m=5;
int [,] matrix=new int[4,m];
Is it possible?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 10:16 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 7:59 PM EDT
Yes it is possible
Regards,
Iftikar
diamond diamond131 reputationPosted Aug 27, 2013, 9:32 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 9:54 PM EDT
diamond diamond131 reputationPosted Aug 27, 2013, 10:01 PM EDT
Error1A field initializer cannot reference the non-static field, method, or property 'test.Form1.size'
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 27, 2013, 10:03 PM EDT
diamond diamond131 reputationPosted Aug 27, 2013, 10:06 PM EDT
{
public partial class Form1 : Form
{
int winc = 1;
int size = 4;
int [,] matrix= new int[4,size];
int [,] UDP_matrix = new int[4,size];