0

I have this program that I can't get to work. It is suppose to make a user made dictionary then print it back out ( have not gotten around to that part yet) When I try to run it I get a wntdll.pbd not loaded error thing that pops up ( see screenshot)There are no other errors or anything. wntdll.pdb not loaded

#include <iostream>
#include <string>

using namespace std;

int numItems;

void userInput(string *terms, string *def) {

    for (int i = 0; i < numItems; ++i) {
        cout << "Enter Term: ";
        cin >> terms[i];
        cout << endl;

        cout << "Enter Def for that term: ";
        cin >> def[i];
        cout << endl;

    }
}


void outputdef() {

}

int main() {

    cout << "How many Items do you want: ";
    cin >> numItems;
    cout << endl;

    string *ptrTerms = new string[numItems];
    string *ptrDef = new string[numItems];

    userInput(ptrTerms, ptrDef);

    delete ptrTerms;
    delete ptrDef;

}

I don't know if it is actually a file problem or a code problem. Thanks for the help.

Edit: Even after following instructions on other post it still throws erros. The error it shows is in delete_scalar.cpp.

Aurum Hype
  • 37
  • 7
  • 2
    Possible duplicate of [wntdll.pdb not loaded - Can't see the exception](https://stackoverflow.com/questions/48203687/wntdll-pdb-not-loaded-cant-see-the-exception) – Axalo Feb 27 '19 at 01:26
  • Don't use `new[]`, use a `std::vector`. As for your code: `new` goes with `delete`, `new[]` with `delete[]`. – Swordfish Feb 27 '19 at 01:32
  • @Swordfish -- sometimes using `new/delete` are the actual point of the lesson. But, failing that, I agree. (and since the code uses `string`, it obviously isn't adverse to container use). – David C. Rankin Feb 27 '19 at 01:33
  • @DavidC.Rankin If it is the lesson to learn from that assignment, it is stupid. – Swordfish Feb 27 '19 at 01:34
  • No, not at all. A lot of the existing codebase uses `new/delete`. It would be more damaging to not teach it and turn a generation of programmers out to maintain code they have no background in. There was a whole lot of C++ code written from the late 80's on that is still lurking around. – David C. Rankin Feb 27 '19 at 01:35
  • A note on pdb files not being found: They are Program DataBase files. You use them mostly for debugging. Unless the missing pdb file is for your programs or libraries, you probably don't care. You aren't debugging the Windows NT Kernel and it's probably not the source of your problem. If it is, fixing the kernel is way, *way* outside the scope of your assignment. – user4581301 Feb 27 '19 at 01:44
  • The reason it is kinda stupid in my mind is that it is an advanced class so we just learned pointers ( never told us anything about arrays hence my struggles) and then they just start throwing using it with strings ( also never told us how to allocate with a string but its not that different) Its basicly alot of stuff we learning all in one project. I think around 3 people finished in class and probably 1/2 are still working on it. – Aurum Hype Feb 27 '19 at 19:04

1 Answers1

0

So as @Swordfish pointed out it is delete[]. That solved the problem. Thanks. Also it was for a class and yeah it is stupid because I would of used vectors but we couldn't.

Aurum Hype
  • 37
  • 7