![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is stack winding and stack unwinding | amitpansuria | High Level Programming | 2 | 08-07-2007 05:46 PM |
| AIX 5.3 Heap Memory with SAP | johnf | AIX | 3 | 10-23-2006 05:21 AM |
| monitor jvm heap size | rein | UNIX for Advanced & Expert Users | 0 | 07-21-2005 08:29 AM |
| heap size for JVM! | i2admin | Filesystems, Disks and Memory | 1 | 05-09-2002 09:09 AM |
| heap size! | i2admin | Filesystems, Disks and Memory | 2 | 05-08-2002 10:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Quote:
On the other hand, in the following case, a will point to a memory location in the stack. Code:
int i = 10; int *a = &i; |
|
||||
|
Code:
main()
{
int *a;
.
.
}
Next problem - gets works on string pointers, not int * So I have no idea where gets would be working. If you are worried about heap being "slower" than stack, don't. Unless you can definitely show that a gets call is a bottleneck - by using a profiler - it is a waste of programmer time to fuss over stuff like that. gets works against the actual memory referenced by the pointer, it has nothing to do with where the pointer itself lives. Andryk - void main () is a BAD idea, especially in a UNIX forum. |
|
|||||
|
Quote:
![]() |
|
||||
|
Memory for both heap and stack is allocated dynamically. The difference is that while stack memory is allocated automatically by the kernel whenever a function is called...heap memory is allocated only-on-request when the program calls malloc(). But as jim mcnamara has pointed out as a programmer you should not fuss over it.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|