Search:

Type: Posts; User: butteflymentor

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    5,877

    Is code loaded into the heap or the stack? or...

    Is code loaded into the heap or the stack? or both? can the programmer control that?
  2. Replies
    14
    Views
    5,877

    I have a 20KB program which I programmed myself,...

    I have a 20KB program which I programmed myself, I never use malloc or any other heap memory allocation function, yet the Task Manager shows a usage of 2.7MB, how do you explain this? The program is...
  3. Replies
    14
    Views
    5,877

    I admit that there is not a single logical...

    I admit that there is not a single logical argument against this, guess it does make sense :P

    Thanks for the help.
  4. Replies
    23
    Views
    5,355

    Android or IOS? Android. Linux or Windows?...

    Android or IOS? Android.
    Linux or Windows? Linux.
    DirectX or OpenGL? OpenGL.

    Opensource ftw!
  5. Replies
    14
    Views
    5,877

    So, A pretty huge video game, such as Assassin's...

    So, A pretty huge video game, such as Assassin's Creed would use 1MB of stack memory and the rest is handled by the heap? That doesn't make sense at all.
    Another example would be svchost.exe, It is...
  6. Replies
    14
    Views
    5,877

    If all Windows programs allocate 1MB of stack...

    If all Windows programs allocate 1MB of stack memory, how come the Windows Task Manager shows a different RAM usage for each program? What do these numbers represent?
  7. It's working flawlessly now (without initializing...

    It's working flawlessly now (without initializing ignored and reserved members).
    Thank you guys!
  8. Some members are ignored unless there is a...

    Some members are ignored unless there is a specific flag in the "flags" member, I don't need to initialize these, do I?Also, do I need to initialize members which are marked "Reserved" by MSDN?
  9. Replies
    14
    Views
    5,877

    How "big" is the run-time stack?

    I have some general programming questions:

    A stack overflow occurs when the stack gets "too big", so, how much is too big?
    Does the run-time stack have a specific size like an array? if so, how...
  10. Here is what I learned by searching online,...

    Here is what I learned by searching online, please correct me if I'm wrong:
    When a variable is declared, the stack pointer is advanced forward, but the values of the memory cells are unchanged. so...
  11. Very useful information,Thank you guys! ...

    Very useful information,Thank you guys!

    Interesting, could you please explain that further? Is it necessary to initialize all variables in C structures? Also, I don't believe that not passing...
  12. declaring a variable makes "GetOpenFileName" misbehave

    Hello, I have a very strange issue. I am new to Win32 programming, therefore I am probably doing something wrong.
    I wrote a function which reads text from a file selected by the user, then puts that...
  13. How do applications interact with the hardware?

    I understand that when a program runs, it stores data (like variables) and also instructions which act upon that data in the RAM. The CPU executes the instructions, and the data is played around with...
  14. Great analogy! The only difference is that the...

    Great analogy! The only difference is that the compiler failed to arrest me, and i managed to get away with it :P
  15. I am not sure. I downloaded the Code::Blocks...

    I am not sure. I downloaded the Code::Blocks version which includes a read-to-use Mingw. Oddly, it does not state which version of Mingw is included.
    The Readme says: "4.4.1-tdm-2"... I am not sure...
  16. Any idea how to achieve that in Code::blocks? I...

    Any idea how to achieve that in Code::blocks?
    I checked all boxes in: Settings > Compiler And Debugger > Compiler Settings > Compiler Flags > Categories:Warnings. Yet the error is still not being...
  17. Exactly! what compiler did you use? The compiler...

    Exactly! what compiler did you use? The compiler I am using (mingw) does not detect this error.

    EDIT: that was a silly question. The first line says "Gcc" :D
  18. Is my assumption incorrect? I don't see how "a...

    Is my assumption incorrect? I don't see how "a function's local variables remain in the stack" differs from "the memory that they occupied remains".
  19. I was expecting the compiler to throw an error or...

    I was expecting the compiler to throw an error or something.
    This time, I ran this modified code:


    #include <stdio.h>
    #include <stdlib.h>
  20. Is it possible that the function "testfunc()" is...

    Is it possible that the function "testfunc()" is returning a COPY of the array "x" ? Edit: The answer is no.
  21. Solved: Are C arrays stored in the stack or the heap?

    Many websites say that C arrays are stored in the Stack, unless malloc() is used. If that is true, then an array is supposed to be destroyed after a function ends. However, I ran a test that...
Results 1 to 21 of 21