A community for students.
Here's the question you clicked on:
 0 viewing
Curry
 one year ago
I'm using gdb, how do I get rid of these random values?
Curry
 one year ago
I'm using gdb, how do I get rid of these random values?

This Question is Closed

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0It looks like your pointer is pointing at an address that is before the actual beginning of the string.

Curry
 one year ago
Best ResponseYou've already chosen the best response.0so what would i pass in gdb?

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0I think the problem fundamentally is the pointer but...

Curry
 one year ago
Best ResponseYou've already chosen the best response.0i can't change the original file they said. :/

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0try using `(&puzzle + 20)` and see what you get

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0can you give a picture

Curry
 one year ago
Best ResponseYou've already chosen the best response.0when i do &puzzle1+5, i get "is watching you"

Curry
 one year ago
Best ResponseYou've already chosen the best response.0ok ok, cause it was 8 bytes from T to i. ok ok. thank you! nice hint!

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0I guess the type of puzzle1 isn't a char, because the pointer arithmetic is moving it far.

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0it looks like it's a type that takes 4 bytes.

anonymous
 one year ago
Best ResponseYou've already chosen the best response.032 bit, could be an integer or something

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0Alternatively, you could have done something like `(((char*) &puzzle1)+12)`.
Ask your own question
Sign UpFind more explanations on OpenStudy
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
 Engagement 19 Mad Hatter
 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.