CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2014

    writing contents of array outside of loop

    I am taking a c# class and one of my assignments is at the end of my program I need to write out to the console the contents of 2 arrays. All of the names in the array should be listed with a score which is in a different array like this:

    scott 10
    bob 20
    ted 40

    I am able to enter all of my names and break out of my loop but when it comes to writing it to the screen in one block I am getting an error that my counter "i" does not exist in the current context.

    If I put the code in the loop I have no issue but it doesn't display the way I want.

    Any suggestions are appreciated.


  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: writing contents of array outside of loop

    Post your code using code tags so we can take a look at what you have.

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.