90 Topics

Member Avatar for
Member Avatar for lilbenji25

Hey, i know you are all probably very bored with the infix to postfix program and its many incarnations but i seem to be having a problem getting the linked list we have to use as a stack to work. More specifically; pushing to the stack, reading from the top …

Member Avatar for nezachem
0
179
Member Avatar for TrustyTony

Not my code but I think free to share. This is intended as beginning point of learning classes or learning data structures. Read the document [url]http://mcsp.wartburg.edu/zelle/python/python-first.html[/url] As first exercise, this does not work instead of the while loop in test part: [CODE] for i in numbers: print i [/CODE] [QUOTE] …

Member Avatar for TrustyTony
0
850
Member Avatar for az_ez

Hi, I've been working on this code but recently there's been a problem with a section of my code, this being that there was a stack overload but now, the code just stays in a loop saying that there is an invald arguement. I don't know how to get it …

Member Avatar for az_ez
0
280
Member Avatar for Prisms

Hey guys I am currently writing a code that will take the user input of a number and convert it to its hexadecimal form with the use of Stack ADT. This is what I have so far and would appreciate any help. [CODE]#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "stack.h" …

Member Avatar for WaltP
0
231
Member Avatar for flaviusilaghi

Could someone help me. I don't know why i get a stack corruption . Here is my program: [CODE]#include<iostream> #include <fstream> #include<conio.h> #include <string> #include "aes.h" using namespace std; int main(int argc, char **argv) { unsigned char key32[32]; unsigned char iv[16]; unsigned char* inbuf=new unsigned char[128]; unsigned char** intext=new unsigned …

Member Avatar for roboknight
0
193
Member Avatar for darelet

Hi all, I'm trying to implement a blob coloring/region labeling algorithm to find and label all blobs/objects in a given image so that at the end of it, I can eliminate all but the largest object. I represented the image by a mask matrix (int binary[image size]) where zero co-ordinate …

0
92
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 John_123

Hey, I have a very basic question regarding the stack in x86 assembly. If I’m correct the main operations on the stack are push and pop (I know there are others). Next to this the stack will grow (keep the location) when the program goes to a subroutine (call) and …

0
69
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
124
Member Avatar for TheFeedingHand

So I'm doing this stack program , and basically when I try to print the elements in the stack, nothing happens... I'm totally lost : ( , any help would be appreciated. Oh and some function names are in spanish, llena means full, vacia means empty, the variable cuenta is …

Member Avatar for mg120
0
176
Member Avatar for ace8957

Hi all, So I'm working on this program to detect if the w' in a string in the form of w$w' satisfies the condition that w' is the reverse of w. The only problem is that I have a logic error that I don't understand. If I input the string …

Member Avatar for ace8957
0
230
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
158
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 livesinabox

So my Turbo C doesn't handle errors. And in school we used VC++ but I don't have it at home. So can anyone tell if the code snippets for Queue and Dequeuing a Queue and Pop and Push operations in Stack are right? [CODE]\int queue::dequeue() { try { if(front>rear) throw …

Member Avatar for Ancient Dragon
0
105
Member Avatar for livesinabox

So I had posted a thread here called "Exception Handling" asking for help excuting this program. Then I discovered CodePad! ( So if any of the moderators could help me delete that thread it will be great! ) So I cleared up most of my errors. And I got an …

Member Avatar for livesinabox
0
145
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
830
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
172
Member Avatar for livestrong2431

I know this is a horrible way to do this, but I'm trying to test out several things that I've learned at once in this code. It's meant to ask you how many numbers you want to add using dynamic memory, then push them on to the stack, and add …

Member Avatar for livestrong2431
0
134
Member Avatar for caierhui

In line 32 which is the lttr[ctr] = read.next().charAt(0); wont read all the letters that i input. it only reads the last letter that i entered. what should i do to be able to display all the letters i entered and be able to reverse there order so that they …

Member Avatar for jon.kiparsky
0
725
Member Avatar for Garrett2011

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 …

Member Avatar for Garrett2011
0
415
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 sm4ckth3monkey

Okay so I have been trying to get this program to work for a long time. Basically it reads a text file then populates a structure that is designed to point to the four locations around that object: up, down, left and right. I believe I have the program figured …

Member Avatar for sm4ckth3monkey
0
648
Member Avatar for Tellalca

I have tried to implement a stack class but i got stupid errors. There is a stupid error i know but i couldnt find it. [CODE]#ifndef STACK_H #define STACK_H /*Manual implementation of Stack class. By this way it will be possible to learn the advantages of Stack data structure over …

Member Avatar for Tellalca
0
223
Member Avatar for habib_parisa

Dear all, I am writting a code for high dimensional chebyshev interpolation. Since it is high dimensional, I MUST use extremely large arrays. Something like this: [CODE] #define DIM (int)2 #define TOTAL_STEPS (int)30 int main(){ double *a_data; long long a_dim; /** length of matrix a_data **/ int n; /** # …

Member Avatar for jephthah
0
183
Member Avatar for juliesyumyum

Hey! I need to program a simple arithmetic calculator. I've done the parser, infix to postfix, etc. Everything's working with no problems except that it only works with one-digit numbers. For example: 10+2 evaluates to 2 instead of 12. Here's the code of the parser: [CODE] package calculator; public class …

Member Avatar for javaAddict
0
201
Member Avatar for kira_

hello there. there's an error in my program that I cannot identify. Every time i call a function for my declared variable of type Stack, there will suddenly be a run time error. I really don't get what's wrong with my code because my implementation seems to be right but …

Member Avatar for mitrmkar
0
103
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
277
Member Avatar for wil0022

hi guys.. my teacher told me to do a program for infix to postfix.. and the post fix evaulation.. I just wanna ask what to use, when making a program like this... example: input: (a+b*c-d) output: abc*+d- is it really possible to input it once? hehe... and btw, could you …

Member Avatar for ddanbe
-1
122

The End.