26 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for gajen007

Hi Friends, Recently I've experienced an issue in my (following) code. I've designed an array-stack and checked the values pushed in to it. It works well when pushing but when popping it doesn't display the whole popped values. E.g: If I pushed the values "zero to nine" in to the …

Member Avatar for rproffitt
0
311
Member Avatar for ddanbe

I'm referring to my snippet [Inheriting the stack class](https://www.daniweb.com/software-development/csharp/code/498828/inheriting-the-stack-class) After looong loong searches and many tries and tests, I finally came up with a version that works as I wanted to. Stacker can now handle any type of object, even with arethmetic methods in place. The virtual way as proposed …

Member Avatar for JOSheaIV
0
276
Member Avatar for brandon66

Im trying to implement queue with a linked list i think i have the enqueue function correct but im having problems with the dequeue. I can get it to delete the first number but then the rest of the list is empty can someone point me in the right direction? …

Member Avatar for brandon66
0
244
Member Avatar for RounaqJJW

#include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #define size 400 using namespace std; char infix[size],postfix[size],Stack[size]; int top; int precedence(char ch) { switch(ch) { case '^':return 5; case '/':return 4; case '*':return 4; case '+':return 3; case '-':return 3; default:return 0; } } char Pop() { char ret; if(top!=-1) { …

Member Avatar for Schol-R-LEA
0
977
Member Avatar for Paulxh

I am trying to change the order of the stack using z-index. as my HTML, CSS and javascript function show in the code below. The three tables are all read into the same location, with only the last table being printed on the screen, since all tables use a white …

Member Avatar for Paulxh
0
2K
Member Avatar for HankReardon

Hello, Would someone be willing to take a look at this segment of code? I am trying to figure out how this segment of code operates. I can see how the program can evaluate a simple prefix statement like + 7 6. I cannot see how the program can solve …

Member Avatar for HankReardon
0
252
Member Avatar for HankReardon

Hello Friends, I am having trouble with a homework assignment and was wondering if you would please take a look at it for me. I have to write a program that receives a prefix expression. Then it calculates and displays the result. It does this by using a stack to …

Member Avatar for HankReardon
0
321
Member Avatar for srivardhanms

Hi, Can anyone tell me how to create a class in C++ such that, the instance of that class cannot be created on stack? Am not able to figure out how to do it. Thank-you in advance, Sri

Member Avatar for srivardhanms
1
172
Member Avatar for DelilahDemented

I have a program that is supposed to match opening and closing braces. It's supposed to work like a stack. It works until the last line of the input file. The last line is matching, but because it thinks the array size is zero it drops out and states that …

Member Avatar for DelilahDemented
0
189
Member Avatar for greatman05

Here's the problem: I need to implement a stack as an adapter to a List class. I don't know what that means though! I've researched on Google countless times and still don't understand what an adapter is. All the examples I've seen point to using inheritance and then using the …

Member Avatar for greatman05
0
403
Member Avatar for fonzi

Hello I am currently working on this code and the code can be runned well from 100-10,000 random elements after that the heap sort says stack over flow, im thinking the recursive calls are the cause of this, so please healp public static void MAX_HEAPIFY(int [] A, int i, int …

Member Avatar for JamesCherrill
0
307
Member Avatar for Kyle Willett

Hi this is a questing from some cs home work. Our task was to take a ada spec file and write the code for the functions and the main program, I have already done this in c++ but am having problems doing it in ada. here is my code: package …

Member Avatar for Kyle Willett
0
603
Member Avatar for while(!success)

Hey guys, I need help recognizing multiple digit numbers that are read so that I may push said number into a stack for future evaluation For example: 22 3 + should evaluate to 25 When I input 22 3 +, my output is evaluated to 5 Any help/criticism is welcome …

Member Avatar for WaltP
0
2K
Member Avatar for baby_c

hi friends.! need little help. I couldn't find the way to check a stack is empty before pop up a element. when my program is running its give a error. please help me guys.. thank you in advance....

Member Avatar for thines01
0
4K
Member Avatar for fadeterra

I searched in this forum, but it didnt help my solve my problem. Please help me. This is my code [I]int intOrderNo = (int) Session["sOrderNo"]; DetailsViewRow row0 = DetailsView1.Rows[0]; string strProductId = row0.Cells[1].Text; DetailsViewRow row6 = DetailsView1.Rows[6]; string strUnitPrice = row6.Cells[1].Text; float floUnitPrice = float.(strUnitPrice); string strQty = DropDownList1.Items[DropDownList1.SelectedIndex].ToString(); int …

Member Avatar for fadeterra
0
327
Member Avatar for flowerzink

Hello there people, I hope you can help me with this one. I'm having a very serious problem when using the Top() method of a stack, difined like this: [CODE]template<class T> T Stack<T>::Top() const {// Return top element. if (IsEmpty()) throw OutOfBounds(); // Top fails else return stack[top]; }[/CODE] and …

Member Avatar for flowerzink
0
253
Member Avatar for ashishchoure

Hi Guys, Is this right to say Heap is RAM and Stack is Pagefile(HardDrive)? Sorry for silly question. :?:

Member Avatar for ashishchoure
0
167
Member Avatar for yuri1969

My func looks like: [CODE]int pop(node **hd, char **new_element) { node *dummy; int i = 0; if (empty(*hd) == 1) { printf("Stack is empty"); return -1; } else { (*new_element)[i] = (*hd)->element[i]; // problem is here ;) dummy = *hd; *hd = (*hd)->next; free(dummy); }[/CODE] and I call it via: …

Member Avatar for yuri1969
0
125
Member Avatar for ace8957

Hey Everyone! So I'm a super beginner trying to teach myself the ins and outs of stacks (ever so slowly). Specifically, I'm trying to work out a programming challenge in which the objective is to write a function to tell if a string in the format of word1$word2 satisfies the …

Member Avatar for ace8957
0
159
Member Avatar for krazyito65

[code] class Node { private: int integer; Node *pointer; public: Node(int x = 0, Node *y = NULL) { integer = x; pointer = y; } int getInteger() { return integer; } Node getPointer() { return *pointer; } }; [/code] [code] private: Node *stack; Node *top; int listSize; int pushedValue; …

Member Avatar for krazyito65
0
217
Member Avatar for nwalser

Ok so I have to write a reverse method of a stack and I am not quite sure how to do it. I understand that i need to pop the strings from one stack into another but whenever I try to do this errors arise. Specifically it says it cannot …

Member Avatar for cale.macdonald
0
831
Member Avatar for crossbow25

SinglyList.h [CODE] #ifndef SINGLYLIST_H #define SINGLYLIST_H #include <iostream> #include <string> using namespace std; class Exception { private: string errMsg; public: Exception(const string& err) { errMsg = err; } }; class InvalidPositionException : public Exception { public: InvalidPositionException(const string& err) : Exception(err){} }; class EmptyException : public Exception { public: EmptyException(const …

Member Avatar for crossbow25
0
249
Member Avatar for coolboym99

I'm writing up a program for a class I'm taking where I need to make a linked list stack & queue. Right now I'm not quite done, but I'm having problems calling the functions from the .h file. What's happening is in the while loop, I'm trying to get data …

Member Avatar for coolboym99
0
199
Member Avatar for aravind rao

Hi I am developing a program that uses Breadth First Search to map a grid(2d array) out. Breadth First Search involves storing nodes in a stack and then exploring these nodes based on Breadth or level. I know how to create a vector array which I shall use as a …

Member Avatar for aravind rao
0
173
Member Avatar for avarionist

I'm trying to just use a normal stack and have it pop the numbers in the order stacks normally go but it just keeps popping 28 (or at least from output thats what i see) it should just be pretty straight forward but .... [CODE] #include <iostream> #include <stack> using …

Member Avatar for avarionist
0
97
Member Avatar for lukebradford

Hi all, and thanks in advance for your help. I have a program which stores some large arrays of ints and reads and writes from text files. main() takes commands with cin and then runs various functions. One of these, generateSentence(), takes three ints and a char* as arguments, but …

Member Avatar for lukebradford
0
278

The End.