Curry
  • Curry
I'm using gdb, how do I get rid of these random values?
Computer Science
chestercat
  • chestercat
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

Curry
  • Curry
anonymous
  • anonymous
It looks like your pointer is pointing at an address that is before the actual beginning of the string.
Curry
  • Curry
so what would i pass in gdb?

Looking for something else?

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

More answers

anonymous
  • anonymous
I think the problem fundamentally is the pointer but...
Curry
  • Curry
i can't change the original file they said. :/
anonymous
  • anonymous
try using `(&puzzle + 20)` and see what you get
anonymous
  • anonymous
`(&puzzle1+20)`
Curry
  • Curry
adress out of bounds
anonymous
  • anonymous
can you give a picture
Curry
  • Curry
when i do &puzzle1+5, i get "is watching you"
anonymous
  • anonymous
What about +4?
Curry
  • Curry
+3 did the trick.
Curry
  • Curry
ok ok, cause it was 8 bytes from T to i. ok ok. thank you! nice hint!
anonymous
  • anonymous
I guess the type of puzzle1 isn't a char, because the pointer arithmetic is moving it far.
anonymous
  • anonymous
it looks like it's a type that takes 4 bytes.
anonymous
  • anonymous
32 bit, could be an integer or something
anonymous
  • anonymous
Alternatively, you could have done something like `(((char*) &puzzle1)+12)`.

Looking for something else?

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