© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
8 replies
tom_brockington

❔ System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'

Why cant i use the int mainStory inside my array?
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' 
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' 

Im making a text based story adventure and i wanted to be able to control the output with one line of code and adding mainStory++ so when it loops round it plays the next line of the story.
c# doesnt want to let me. the picture should clear it up for you.
Thanks Tom
Screenshot_530.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
C#CC# / help
3y ago
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
C#CC# / help
11mo ago
❔ System.IndexOutOfRangeException has been thrown"Index was outside the bounds of the array."
C#CC# / help
3y ago
✅ Index was outside of bounds of the array
C#CC# / help
3y ago