CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #4
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    19

    Lightbulb Re: passing arrays to functions

    Hello.
    What u did krishnaa wouldn't help to do the formatting though it could be used to print the elements of the array.

    What seems a plausible explanation to me is that when we pass a 1d array we dont need to pass the size as an array is always passed by reference. So the function has direct access to the array in a way. Hence one can easily check for the NULL character to check for the array end.

    However in case of multi dimensional arrays, which are actually stored in contiguous memory locations, we need to know exactly how many elements form a (logical) row so that the correct element could be picked by the compiler. So we need to pass the subsequent subscripts I guess.

    please reconfirm or correct me if im wrong here..
    Last edited by aijazbaig1; July 12th, 2006 at 09:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured