Skip to content

memory access violation #2

Description

@123TzTz321

https://github.com/NumericalMax/Linear-Regression/blob/master/main.cpp#L109
a is lxl but https://github.com/NumericalMax/Linear-Regression/blob/master/main.cpp#L118 would point beyond

diff --git a/main.cpp b/main.cpp
index 4e306d1..7a23a44 100644
--- a/main.cpp
+++ b/main.cpp
@@ -106,7 +106,7 @@ namespace matrixOperation{
         float t;
         float **a = new float*[l];
         for(int i = 0; i < l; ++i){
-            a[i] = new float[l];
+            a[i] = new float[2*l];
         }
         for(i=0;i<l;i++){
             for(j=0;j<l;j++){

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions