Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (curry):

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*)

OpenStudy (curry):

@wio

OpenStudy (anonymous):

I don't know either

OpenStudy (curry):

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

OpenStudy (anonymous):

I'm guessing gdb kept them

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!