By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,513 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,513 IT Pros & Developers. It's quick & easy.

Access violation exception in VC 6. while running a tokenizer attempt using vector

P: 3
ok I made this exercise, for a compiler design course. it is not urgent as the assignment was due 2 days ago. i got a 4 out of 10 for effort. mainly because i did not just rehash code examples from the deitel&deitel c++ books. now i get the program to compile, but when run, it throws an access violation exception.
So to summarize: the program asks the user for the filename of the source file, opens it with fopen for reading, then takes the filename and adds the termination *.tok to the string, opens a new file with the same name and new termination for writing. now we read the first file into a vector A, we copy it to a vector B(although this step might be unnecessary),we close the first file, we tokenize the second vector and write it to the second file. Finally we close the second file.

now i learned C++ years ago, but for the last year i've been working on a AS400 environment with ILE RPG,PLEX, and SYNON languages, and this might have dulled my brain a little. as such before this course it had been 14 months since I last touched C++. any help would be appreciated. contact me for the code if you have time.
Jun 1 '07 #1
Share this Question
Share on Google+
1 Reply

P: 1,806
Sounds like you are either:
breaching memory outside of where you intended
trying to access a NULL variable as though it were initialised......

There may be different causes, but it is a little difficult to be more specific with the infoprmation given.......

Quite often, it means you have declared something, but never initialised it (particular with poiters to structs etc), and then are trying to access an element in the unitialised data structure
Jun 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.