A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Curry

  • one year ago

I ran a c program with the main function having (argc, argv[]) as parameters. I ran gdb with no parameters, then i ran it with the argument 5, and then i reran it with no parameters, but when i printed out all the values of argv, i have the folder source and the value "5" in the array. I don't understand how the 5 still got there when i reran the program without passing it an argument. (This is all through gdb, so i reran it by simply pressing r *enter*)

  • This Question is Closed
  1. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @wio

  2. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I don't know either

  3. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    my only explanation was that possible the main stack frame isn't being popped, so it just stays there.

  4. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm guessing gdb kept them

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.