473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Direction of stack progression

How to find whether the stack is progressing in forward or backward direction using C?
Aug 3 '07 #1
3 2586
JosAH
11,448 Expert 8TB
How to find whether the stack is progressing in forward or backward direction using C?
You're not supposed to care about that, but if you really want to know you can
take the address of a local variable; call another method that returns the address
of one of its own local variables, cast the two to longs (or other ints) and subtract
the two.

If your C implementation doesn't use a stack (which is very well possible although
not common) you're out of luck: no stack, neither ascending nor descending.

kind regards,

Jos
Aug 3 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
whether the stack is progressing in forward or backward direction using C?
The question is irrelevant. A stack is a LAST-IN-FIRST-OUT queue. There can be many implementaions.
Aug 3 '07 #3
Fine..thank u....i ll see to it...
Aug 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Alexander Eisenhuth | last post by:
Hello everybody, i wonder how the win32 COM extension handles different C-int types (short, int, long). Another question for me is weather the "out-direction" of parameter is supported "out of...
3
by: gary | last post by:
Hi, 1. About all C/C++ compilers, Does stack increase from high address to low address and heap grow increase from low to high? What on earth decides their increase direction, CPU architecture, OS...
6
by: Adam Warner | last post by:
Hi all, Is this a (C99) portable way to detect whether the C stack grows upwards (1) or downwards (-1)? #include <stdio.h> int stack_direction=0; void detect_stack_direction(void *...
4
by: Sagaert Johan | last post by:
Hi Is this something for C# V2 ? Queue msgqueue =new Queue (); //fill some data in the queue here with this function & keep only the last 5 events void addtolog(string msg) {
4
by: Kevin | last post by:
I tried writing a program to get the first few terms of a geometric progression.After the execution, I got -858993460 before the start of the series.i have used int for all variables. what...
18
by: junky_fellow | last post by:
Hi all, Is there any way by which we mat determine the direction of stack growth (from higher address to lower address Or from lower address to higher address) ? I know this question is...
0
by: Rasika WIJAYARATNE | last post by:
Hello everyone, We have a forum system on our website. The main web application is running in a virutal directory called /t7 and the forum system is on / t7/forums/. When someone wants to post...
3
by: sivasujithsp | last post by:
Hi all, I am designing a Programmer for Microcontrollers in VB6.0 How to use a progression bar to show the process, FYI, to start the progression bar i recieve a start_character and at the...
5
by: vix290788 | last post by:
Hi, I have been attempting a question for hours now and don't seem to be getting anywhere. I have to return a vector of <long> containing the arithmetic progression up to N terms, with a and d long...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.