Click here to Skip to main content
14,664,507 members
Rate this:
Please Sign up or sign in to vote.
See more:
Sir, you said not to return arrays from a property....so I'm thinking this way...because
I need a method in a class that will return a static array which is to be consumed by another class..
Suppose...
class a
{
    public static string[,,,] row;
    private string[,,,] DoSomething()
    {
         Do some work with row...
         return row;
    }
}

class B
{
    public void Consumer()
    {
        a d=new a();
        d.DoSomething();
        private string[,,,] col;
        col=a.row;
        Do some work.....
    }
}
This will be the program....


What I have tried:

This is the way I am thinking and have tried....as Sir you have told property shouldnn't return arrays.....So this way thought....So Sir will there be any performance problem...
Sir for your information.... lot of work had been done using multi--dimensional array, so I don't want to modify those coding.....but newly written code shall be written without any problems.. By Sir I want to mean OriginalGriff...as he is guiding me....
Posted
Updated 11-Jul-20 3:48am
v3
Comments
Garth J Lancaster 11-Jul-20 9:04am
   
Sir ? to which 'Sir' do you refer to - this doesnt make sense without the original reference or article - you would have been better off to reply there or to use 'Improve question'
Member 12712527 11-Jul-20 9:43am
   
I referred to Mr. OriginalGriff....
Richard MacCutchan 11-Jul-20 9:59am
   
Then reply to the message he posted, rather than opening a new question and hoping that he happens across it. Despite the fact that ...
Richard MacCutchan 11-Jul-20 10:02am
   
You have declared Dosomething as private so it cannot be called from outside of the class. And using a static property is a bad idea as it means you cannot have more than one instance of the a class in your application. But the real question is what exactly you need a 3D array for in the first palce.
Member 12712527 11-Jul-20 10:18am
   
4-Dimensional Array....
Member 12712527 11-Jul-20 10:20am
   
But Sir the question was downvoted. Still shall he come across it....?
CHill60 13-Jul-20 10:47am
   
If you use the "Reply" link to a post then that member is notified of your reply. Unlike all of your comments here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100