Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9221057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:29:33+00:00 2026-06-18T03:29:33+00:00

I wrote a function that adds lines from a richTextbox into a array and

  • 0

I wrote a function that adds lines from a richTextbox into a array and than adds them to the chart.

        double y[] = { 0 };
        double x[] = { 0 };

        String^ name = "Pobrana moc";
        chart1->Series->Clear();
        chart1->Series->Add(name);

        for (int i=0; i < richTextBox1->Lines->Length; i++){ 
            y[i] = Convert::ToDouble(richTextBox1->Lines[i]);
            x[i] = i+1;
            chart1->Series[name]->Points->AddXY( x[i] , y[i] );
        }

I compile the program with no problems detected. When I run it and call this function the program closes with this message:
The program ‘[6356] GUI.exe: Managed (v4.0.30319)’ has exited with code -1073740791 (0xc0000409).

If I replace all “i” with a number it works perfectly well:

            y[0] = Convert::ToDouble(richTextBox1->Lines[0]);
            x[0] = 1;
            chart1->Series[name]->Points->AddXY( x[0] , y[0] );

What have I done wrong, or is there any other way to make it work? I need it to add as many points to the chart as there are lines in the richTextbox.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:29:34+00:00Added an answer on June 18, 2026 at 3:29 am

    You’re writing past the end of x and y, which is undefined behaviour. You need to make sure they’re large enough for richTextBox1->Lines->Length elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a jQuery function that dynamically adds or removes messages boxes from the
I wrote a function that searches for a char in an array, and if
I wrote a function that builds an XML string based on the data saved
I'm trying to write a javascript function that adds some DOM nodes to the
If we write virtual function it adds a vtable in object of that class.
I wrote a function that scans a tab delimited file of baseball stats. public
So I wrote this function that is given possible numbers, and it has to
i wrote a custom jquery function that accept a callback but not being able
I wrote a simple function, that makes emacs add matching quotes (so when I
I've got a function I wrote quite some time ago that works fine, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.