What "[ ]" means in the method declaration

Asked

Viewed 78 times

3

I have the following method

public BITalinoFrame[] Read(int nbSamples)
{
    try
    {
        return device.ReadFrames(nbSamples);
    }
    catch (Exception ex)
    {
        WriteLog("Error reading the frames: " + ex.Message);
    }    
    return null;
}

what I need to know is what the part means:

public BITalinoFrame[] Read(int nbSamples)
  • 1

    That this method returns an array of type BITalinoFrame.

1 answer

6


It means that the type to be returned is a array of class elements BITalinoFrame.

for example, the method below returns a array whole:

public int[] ListaInteiros()
{
    int[] lista = new int[5] { 1, 2, 3, 4, 5 };
    return lista;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.