I'm a newbie in any programming, and recently must work on c++. I have a difficulty in forming an array and reading a file at the same time. I have tried the code, but I couldn't understand why it is not working (access violation error). Appreciating any advise. Thank you..
12:17: warning: unused parameter 'nC' [-Wunused-parameter] In function 'int main()':
31:45: error: 'dset' was not declared in this scope
40:16: error: 'gen' was not declared in this scope
44:6: error: expected unqualified-id before '=' token
46:7: error: 's' was not declared in this scope
46:18: error: 'nS' was not declared in this scope
47:10: error: expected unqualified-id before '[' token
48:11: error: 'nN' was not declared in this scope
48:16: error: 'nS' was not declared in this scope
55:10: error: 't' was not declared in this scope
55:21: error: 'nT' was not declared in this scope
57:12: error: expected unqualified-id before '[' token
61:9: error: expected primary-expression before ')' token
25:6: warning: unused variable 'n' [-Wunused-variable]
At global scope:
62:2: warning: extra ';' [-Wpedantic]
Best advice is to use a std::vector and not arrays, and don't do manual memory management. Try to avoid using pointers.
Try to write that is easy to read, choose good variable and function names.
Always initialise your variables. Read the manual.
Must have an object of the class type, before one can call the class functions
check the obvious pointer problems or get rid of the pointers.
.. is the outer dimension correct in your debugger?
the inner dimension?
the loop iterations, are they also the expected bounds?
is there a reason for the pointers here? Would a vector work?
line 48 looks funky to me.
you say ni is nn*ns but you allocated (init function) with nn
its a little hard to follow the variable names....
Thank you for the advise. I will reprocess the array with CPLEX but let me try to initiate it with vector, as well as find better way to revise line 48. Thank you