cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Dynamic Progamming
Dynamic Progamming
May 13, 2013 at 7:43am UTC
Carolpp
(3)
I am getting "Access violation reading location 0x029C4010."error while running this program though It does not show any errors.
What is wrong with this? thanks for looking into it.
ifstream myfile;
Last edited on
May 14, 2013 at 10:10pm UTC
May 13, 2013 at 7:53am UTC
Bourgond Aries
(415)
Use code tags
http://www.cplusplus.com/articles/z13hAqkS/
Using GDB debugger the segfault occurs @ A[i] = name;
Adding a watch to i shows us that i = 1000000;
May 13, 2013 at 7:53am UTC
keskiverto
(10402)
Are you sure the magic number is enough? Would it not be neater to use std::vector, which has push_back()?
Are you sure that all of the
myfile>>name>>V[i]>>S[i];
succeeds every time?
Why do you read into char array instead of std::string?
The A, V, S together could be a struct?
Edit: "Dynamic programming"?
Last edited on
May 13, 2013 at 7:55am UTC
May 14, 2013 at 6:59am UTC
Carolpp
(3)
Thanks. I used a vector instead of array.
Topic archived. No new replies allowed.