Well I had an assignment to sort an array of structures so i went about trying but always some strange fault come about. Now not only does the main program fail but also another program. What i want to know is that is it a problem in my code, or something else is happening?? Below are the two programs!!
Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
struct boy
{
Consider a language that does not have arrays but does have
stacks as a data type.and PUSH POP..are all defined .Show
how a one dimensional array can be implemented by using two
stacks.
I am unable to solve this. Can somebody tell me whats the approach one should follow? I dnt need the code, only approch will suffice.
how does an optimizing c++ compiler reuse stack slots of a function?
How does an optimizing c++ compiler determine when a stack slot of a function(part of stack frame of a function) is no longer needed by that function, so it can reuse its memory? .
By stack slot I mean a part of stack frame of a function, not necessarily a whole stack frame of a function and an example to clarify the matter is, suppose we have a function that has six integer variables defined in its scope, when it's time to use sixth variable...
Hey I am in the middle of Java and I am having trouble drawing heap stack diagrams from code. I have two that I really need help with.
First code:
public class HEAPSTACK extends ConsoleProgram{
public void run(){
Integer n1=1;
Integer n2=20;
int computation=met h(n1,n2);
println("comput ation:"+computa tion);
Draw the heap-stack diagram when println has been called...
Hi all,
I am still in the process of lerning how to write decent C++ code. I will appreciate any good advice or corrections. I have two questions, a technical one and one for advice for how to design my code.
1. I have read somewhere (can't remember, must have been some tutorial page) that objects allocated on the heap can only be accessed through pointers. Thus, for example