Array of MemoryStream

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mimi

    Array of MemoryStream

    Is it possible to have an array of MemoryStream?

    MemoryStream[] memStr = new MemoryStream[10];

    It seems to allow me to compile this but crashes when I try to do anything
    with memStr.


  • Michael C

    #2
    Re: Array of MemoryStream

    "Mimi" <Mimi@discussio ns.microsoft.co m> wrote in message
    news:C8450BA9-2C6F-4A2F-BC89-EC190F3B073A@mi crosoft.com...[color=blue]
    > Is it possible to have an array of MemoryStream?
    >
    > MemoryStream[] memStr = new MemoryStream[10];
    >
    > It seems to allow me to compile this but crashes when I try to do anything
    > with memStr.[/color]

    Should work no problem. You will need to set each item in the array to a new
    MemoryStream. Your "new MemoryStream[10]" creates a new array but each item
    in the array is null. It's a good idea to give the error message, "crashes"
    doesn't give ppl much to go on.

    Michael


    Comment

    Working...