Search:

Type: Posts; User: donthate

Search: Search took 0.00 seconds.

  1. Thread: Locating ebp?

    by donthate
    Replies
    3
    Views
    2,508

    I would be doing this once when the program...

    I would be doing this once when the program stops. How could I take a pointer to the first function argument if I don't know the function I'm in?
  2. Thread: Locating ebp?

    by donthate
    Replies
    3
    Views
    2,508

    Locating ebp?

    I'm writing a program that involves traversing the stack, and I need to find out how to locate the current base pointer without information about the current function. I know there is a way to do it...
  3. Replies
    2
    Views
    895

    Great, thank you!! :)

    Great, thank you!! :)
  4. Replies
    2
    Views
    895

    question about realloc

    I was wondering about how realloc is implemented: so lets say you originally had an n-byte array malloc'ed and you want to now have a 2n-byte array. Then realloc can increase the bytes available for...
  5. So what if s1 was malloc'ed 4 characters and is...

    So what if s1 was malloc'ed 4 characters and is "abcd" and s2 is "efg." Then how is the space allocated and added to s1 to be able to fit in s2?
  6. Oh ok-even if the arrays were malloc'ed? So...

    Oh ok-even if the arrays were malloc'ed?

    So how exactly does strcat work?
  7. Got it, thank you for clearing that up! Also,...

    Got it, thank you for clearing that up!

    Also, another question involving strcat-when you use strcat(s1,s2) it appends s2 to s1 right? but then if I try to change s2, then the change will be...
  8. clearing a c-string vs. freeing the memory there

    Hey guys,
    In my program I am gradually clearing c-strings in an array by setting array[0] to '\0'.

    Does this free the memory too? I didn't think that it would but then if I clear one of the...
  9. Update: after thinking about what you said, I...

    Update: after thinking about what you said, I fixed the leak by using strcopy instead. I think everything is working correctly. The only thing is that according to valgrind I apparently allocate...
  10. Ok that makes a lot of sense. One question...

    Ok that makes a lot of sense.

    One question though: since I'm allocating space for each of the storefrag elements that is not equal to the size allocated for tfrag, when I use strdup to return a...
  11. Thanks for your replies. I realize it's hard to...

    Thanks for your replies. I realize it's hard to help without some code, so here is the relevant bit. I

    I want to call ReadAndStore to read a file, allocate some memory to store the file contents,...
  12. I guess the reason I wanted to allocate...

    I guess the reason I wanted to allocate separately is because I can't pass in array because I don't know the sizes of the arrays I want until I get into that function. If I move that part of the...
  13. allocating heap memory and passing ownership

    Hi there,

    I'm writing a function that
    - allocates memory for ptarray, a **char with enough space for n *char's using malloc
    - as it reads a file, allocates an appropriate amount of space for the...
Results 1 to 13 of 13