Thread: Help With Stacks

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    21

    Help With Stacks

    Hello, I am creating a program to add and multiply large numbers using stacks. I have been working on the program all day and I believe I am on the verge of completing it, but right now the addition and multiplication functions are not doing their job correctly. I'm not entirely sure why, and I was hoping someone here could assist me in finding out the source of this problem. Thank you for your time and any help is appreciated, no matter how small.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    /*Define the limit of the stacks.*/
    #define MAXSTACK 100
    
    /*Defines the structure of a stack.*/
    typedef struct {
    	int digits[MAXSTACK];
    	int top;
    }arraystack;
    
    /*Pushes new item onto the stack.*/
    void push(arraystack *x, int y);
    /*Pops new item from the stack.*/
    void pop(arraystack *x, int y);
    /*Pops items from stack and prints them.*/
    void popprint(arraystack *x, int y);
    /*Checks to see if the stack is empty.*/
    int isEmpty(arraystack *x);
    /*Addition function.*/
    void addition(arraystack *x, arraystack *y);
    /*Multiplication function.*/
    void multiplication(arraystack *x, arraystack *y);
    /*Revised addition function for use with multiplication.*/
    arraystack *addformult(arraystack *x, arraystack *y);
    
    /*Structs will be global.*/
    arraystack value1;
    arraystack value2;
    arraystack dummy;
    arraystack temp1;
    arraystack result;
    
    int main(void)
    {
    	/*Variables for file input.*/
    	FILE *ifp;
    	char filename[30];
    	/*Variables for loops.*/
    	int counter, i, j;
    	/*Variables for strings.*/
    	char num1[100];
    	char num2[100];
    	/*Variables for conversion.*/
    	char c1;
    	int digit = 0;
    
    	/*Initialize top of stacks.*/
    	value1.top = -1;
    	value2.top = -1;
    	dummy.top = -1;
    	temp1.top = -1;
    	result.top = -1;
    
    	/*Ask for input file.*/
    	printf("Please enter the filename of the file you wish to open: ");
    	scanf("%s", &filename);
    
    	/*Open input file.*/
    	ifp = fopen(filename, "r");
    
    	/*Get number of digit sets from file.*/
    	fscanf(ifp, "%d", &counter);
    
    	/*For the number of digits in the file:*/
    	for (i = 0; i < counter; i++) {
    		/*Read in the first number.*/
    		fscanf(ifp, "%s", &num1);
    		/*Read in the next number.*/
    		fscanf(ifp, "%s", &num2);
    		/*Convert first number into a digit and push it into the first array.*/
    		j = 0;
    		while(num1[j] != '\0') {
    			c1 = num1[i];
    			digit = c1 - '0';
    			push(&value1, digit);
    			j++;
    		}
    		/*Convert second number into a digit and push it into the second array.*/
    		j = 0;
    		while(num2[j] != '\0') {
    			c1 = num2[i];
    			digit = c1 - '0';
    			push(&value2, digit);
    			j++;
    		}
    		/*Add the two arrays.*/
    		addition(&value1, &value2);
    		/*Multiply the two arrays.*/
    		multiplication(&value1, &value2);
    	}
    
    	/*Close input file.*/
    	fclose(ifp);
    
    	/*End program.*/
    	return 0;
    }
    
    /*Pushes items onto a stack.*/
    void push(arraystack *x, int y) {
    	/*If the stack is full:*/
    	if (x->top >= MAXSTACK - 1) {
    		/*Error.*/
    		printf("Stack is full.\n");
    	}
    	/*Otherwise:*/
    	else {
    		/*Stack top raises by 1 and new digit is added.*/
    		x->top = x->top + 1;
    		x->digits[x->top] = y;
    	}
    }
    
    /*Pops items from a stack.*/
    void pop(arraystack *x, int y) {
    	/*If the stack is empty:*/
    	if (x->top < 0) {
    		/*Error.*/
    		printf("Stack is empty.\n");
    	}
    	/*Otherwise:*/
    	else {
    		/*New digit is popped and stack top lowers by 1.*/
    		y = x->digits[x->top];
    		x->top = x->top - 1;
    	}
    }
    
    /*Checks to see if the stack is empty.*/
    int isEmpty(arraystack *x) {
    	return (x->top < 0);
    }
    
    /*Pops items from stack and prints them.*/
    void popprint(arraystack *x, int y) {
    	/*Variable for loop.*/
    	int i;
    	/*If the stack is empty:*/
    	if (x->top < 0) {
    		/*Error.*/
    		printf("Stack is empty.\n");
    	}
    	/*Otherwise:*/
    	else {
    		/*New digit is popped and printed and stack top lowers by 1.*/
    		y = x->digits[x->top];
    		for (i = 0; i <= x->top; i++) {
    			printf("%d", y);
    		}
    		printf("\n");
    		x->top = x->top - 1;
    	}
    }
    
    /*Addition function.*/
    void addition(arraystack *x, arraystack *y) {
    	/*Variable for carry.*/
    	int carry = 0;
    	/*Variables for adding.*/
    	int num1, num2, sum;
    	/*Variable for printing.*/
    	int digit = 0;
    	/*While one stack is not empty:*/
    	while (x->top >= 0 || y->top >= 0) {
    		/*If first stack is empty:*/
    		if (x->top < 0) {
    			/*First addend is 0.*/
    			num1 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the first addend.*/
    			pop(x, num1);
    		}
    		/*If second stack is empty:*/
    		if (y->top < 0) {
    			/*Second addend is 0.*/
    			num2 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the second addend.*/
    			pop (y, num2);
    		}
    		/*Add num1, num2, and carry to get the sum.*/
    		sum = num1 + num2 + carry;
    		/*If sum < 10:*/
    		if (sum < 10) {
    			/*Carry = 0.*/
    			carry = 0;
    			/*Sum is pushed on the result stack.*/
    			push(&result, sum);
    		}
    		/*Else:*/
    		else {
    			/*Unit of result is pushed on result stack.*/
    			sum = sum % 10;
    			push(&result, sum);
    			/*Carry = 1.*/
    			carry = 1;
    		}
    	}
    	/*If carry is 1 after loop:*/
    	if (carry = 1) {
    		/*Push carry onto stack.*/
    		push(&result, carry);
    	}
    	/*Call popprint and send result.*/
    	popprint(&result, digit);
    }
    
    /*Multiplication function.*/
    void multiplication(arraystack *x, arraystack *y) {
    	/*Variable for carry.*/
    	int carry = 0;
    	/*Variable for deciding factor.*/
    	int decide = 0;
    	/*Variable for loop.*/
    	int i;
    	/*Variables for product.*/
    	int num1 = 0;
    	int num2 = 0; 
    	int product;
    	/*Variable for printing.*/
    	int digit = 0;
    	/*While second stack is not empty:*/
    	while (y->top >= 0) {
    		/*Add the necessary zeros to first temp stack.*/
    		for (i = 0; i < decide; i++) {
    			push(&temp1, 0);
    		}
    		/*Dummy stack is equivalent to first value stack.*/
    		for (i = 0; i <= value1.top; i++) {
    			dummy.digits[i] = value1.digits [i];
    		}
    		/*Pop value from second value stack.*/
    		pop(y, num2);
    		/*For the duration of dummy stack:*/
    		while (dummy.top >= 0) {
    			/*Pop value from dummy stack.*/
    			pop(&dummy, num1);
    			/*Multipy numbers and add carry to get product.*/
    			product = (num1 * num2) + carry;
    			/*If product is less than 10:*/
    			if (product < 10) {
    				/*Carry equals zero.*/
    				carry = 0;
    				/*Product is pushed onto first temp stack.*/
    				push(&temp1, product);
    			}
    			/*If product is 10 or greater:*/
    			else {
    				/*Value of product % 10 is pushed onto stack.*/
    				product = product % 10;
    				push(&temp1, product);
    				/*Value of (product-(product%10))/10 becomes carry.*/
    				carry = (product-(product%10))/10;
    			}
    		}
    		/*If second temp stack is empty:*/
    		if (result.top < 0) {
    			/*Second temp stack is first temp stack.*/
    			result = temp1;
    			/*First temp stack is emptied.*/
    			temp1.top = -1;
    		}
    		/*Otherwise:*/
    		else {
    			/*Add two temp stacks together.*/
    			addformult(&temp1, &result);
    			/*First temp stack is emptied.*/
    			temp1.top = -1;
    		}
    		/*Add 1 to deciding factor.*/
    		decide = decide + 1;
    	}
    	/*Call popprint and print result.*/
    	popprint(&result, digit);
    }
    
    /*Revised addition function for use with multiplication.*/
    arraystack *addformult(arraystack *x, arraystack *y) {
    	/*Variable for carry.*/
    	int carry = 0;
    	/*Variables for adding.*/
    	int num1, num2, sum;
    	/*Variable for printing.*/
    	int digit = 0;
    	/*While one stack is not empty:*/
    	while (x->top >= 0 || y->top >= 0) {
    		/*If first stack is empty:*/
    		if (x->top < 0) {
    			/*First addend is 0.*/
    			num1 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the first addend.*/
    			pop(x, num1);
    		}
    		/*If second stack is empty:*/
    		if (y->top < 0) {
    			/*Second addend is 0.*/
    			num2 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the second addend.*/
    			pop (y, num2);
    		}
    		/*Add num1, num2, and carry to get the sum.*/
    		sum = num1 + num2 + carry;
    		/*If sum < 10:*/
    		if (sum < 10) {
    			/*Carry = 0.*/
    			carry = 0;
    			/*Sum is pushed on the result stack.*/
    			push(&result, sum);
    		}
    		/*Else:*/
    		else {
    			/*Unit of result is pushed on result stack.*/
    			sum = sum % 10;
    			push (&result, sum);
    			/*Carry = 1.*/
    			carry = 1;
    		}
    	}
    	/*If carry is 1 after loop:*/
    	if (carry = 1) {
    		/*Push carry onto stack.*/
    		push (&result, carry);
    	}
    	/*Send result to multiplication.*/
    	return &result;
    }

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Code:
    	/*If carry is 1 after loop:*/
    	if (carry = 1) {
    		/*Push carry onto stack.*/
    		push (&result, carry);
    	}
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Why are you using global variables if you insist on passing them around to functions? Also, 'result' isn't a pointer, so don't try to make it one. You can't deallocate / reallocate it. You can't make it point to something else. It's painfully hard to read your program when you insist on using globals for everything.

    I would suggest making sure your stack works correctly first. Make it push, pop, peek, whatever. Once you know that you know that you know that works flawlessly, then use it for something.


    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    21
    Quote Originally Posted by dwks
    Code:
    	/*If carry is 1 after loop:*/
    	if (carry = 1) {
    		/*Push carry onto stack.*/
    		push (&result, carry);
    	}
    Well that's interesting. How'd I miss that?

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    There's two of them (virtue of the clipboard).
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    Registered User
    Join Date
    Jul 2005
    Posts
    21
    Quote Originally Posted by quzah
    Why are you using global variables if you insist on passing them around to functions? Also, 'result' isn't a pointer, so don't try to make it one. You can't deallocate / reallocate it. You can't make it point to something else. It's painfully hard to read your program when you insist on using globals for everything.

    I would suggest making sure your stack works correctly first. Make it push, pop, peek, whatever. Once you know that you know that you know that works flawlessly, then use it for something.


    Quzah.
    On the subject of result, I'm only going by what my compiler told me to do and the syntax that I've read in my notes. Result is supposed to be pointing to the result stack that I declared at the beginning of the program.

    I made the five stacks global because I don't want to pass along more stacks than I have to. I know that if they're all global I really don't have to pass anything at all, but I thought it would make things easier if I just passed the stacks I needed to like normal and have the functions work on the other stacks directly. Is that what's causing the program to malfunction?

    And I apologize if that makes the program difficult to read.

  7. #7
    Registered User
    Join Date
    Jul 2005
    Posts
    21
    Quote Originally Posted by dwks
    There's two of them (virtue of the clipboard).
    Thanks. That didn't solve the problem but that would've been a problem down the road.

  8. #8
    Registered User
    Join Date
    Jul 2005
    Posts
    21
    Altered the code thanks to assistance on another forum. Still doesn't work but it's one step closer.

    Changed the code again. Problem still exists but it's starting to clear away.

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    /*Define the limit of the stacks.*/
    #define MAXSTACK 100
    
    /*Defines the structure of a stack.*/
    typedef struct {
    	int digits[MAXSTACK];
    	int top;
    }arraystack;
    
    /*Pushes new item onto the stack.*/
    void push(arraystack *x, int y);
    /*Pops new item from the stack.*/
    int pop(arraystack *x);
    /*Pops items from stack and prints them.*/
    void popprint(arraystack *x);
    /*Checks to see if the stack is empty.*/
    int isEmpty(arraystack *x);
    /*Addition function.*/
    void addition(arraystack *x, arraystack *y);
    /*Multiplication function.*/
    void multiplication(arraystack *x, arraystack *y);
    /*Revised addition function for use with multiplication.*/
    arraystack *addformult(arraystack *x, arraystack *y);
    
    /*Structs will be global.*/
    arraystack value1;
    arraystack value2;
    arraystack dummy;
    arraystack temp1;
    arraystack result;
    
    /*Name: Matthew Barak
    PID: ma241840
    Course: COP 3502
    Assignment Number: 2
    Title: Large Numbers
    Program Description: Reads in numbers from an outside file, stores them in stacks,
    and adds and multiplies them.
    Date: 10/09/05
    Bonus Part Attempted: No
    Created In: Visual C++
    */
    
    int main(void)
    {
    	/*Variables for file input.*/
    	FILE *ifp;
    	char filename[30];
    	/*Variables for loops.*/
    	int counter, i, j;
    	/*Variables for strings.*/
    	char num1[100];
    	char num2[100];
    	/*Variables for conversion.*/
    	char c1;
    	int digit = 0;
    
    	/*Initialize top of stacks.*/
    	value1.top = -1;
    	value2.top = -1;
    	dummy.top = -1;
    	temp1.top = -1;
    	result.top = -1;
    
    	/*Ask for input file.*/
    	printf("Please enter the filename of the file you wish to open: ");
    	scanf("%s", filename);
    
    	/*Open input file.*/
    	ifp = fopen(filename, "r");
    
    	/*Get number of digit sets from file.*/
    	fscanf(ifp, "%d", &counter);
    
    	/*For the number of digits in the file:*/
    	for (i = 0; i < counter; i++) {
    		/*Read in the first number.*/
    		fscanf(ifp, "%s", num1);
    		/*Read in the next number.*/
    		fscanf(ifp, "%s", num2);
    		/*Convert first number into a digit and push it into the first array.*/
    		j = 0;
    		while(num1[j] != '\0') {
    			c1 = num1[i];
    			digit = c1 - '0';
    			push(&value1, digit);
    			j++;
    		}
    		/*Convert second number into a digit and push it into the second array.*/
    		j = 0;
    		while(num2[j] != '\0') {
    			c1 = num2[i];
    			digit = c1 - '0';
    			push(&value2, digit);
    			j++;
    		}
    		/*Reset stacks.*/
    		dummy.top = -1;
    		temp1.top = -1;
    		result.top = -1;
    		/*Add the two arrays.*/
    		addition(&value1, &value2);
    		/*Multiply the two arrays.*/
    		multiplication(&value1, &value2);
    	}
    
    	/*Close input file.*/
    	fclose(ifp);
    
    	/*End program.*/
    	return 0;
    }
    
    /*Pushes items onto a stack.*/
    void push(arraystack *x, int y) {
    	/*If the stack is full:*/
    	if (x->top >= MAXSTACK - 1) {
    		/*Error.*/
    		printf("Stack is full.\n");
    	}
    	/*Otherwise:*/
    	else {
    		/*Stack top raises by 1 and new digit is added.*/
    		x->top = x->top + 1;
    		x->digits[x->top] = y;
    	}
    }
    
    /*Pops items from a stack.*/
    int pop(arraystack *x) {
    	int y;
    	/*If the stack is empty:*/
    	if (x->top < 0) {
    		/*Error.*/
    		printf("Stack is empty.\n");
    	}
    	/*Otherwise:*/
    	else {
    		/*New digit is popped and stack top lowers by 1.*/
    		y = x->digits[x->top];
    		x->top = x->top - 1;
    	}
    	return y;
    }
    
    /*Checks to see if the stack is empty.*/
    int isEmpty(arraystack *x) {
    	return (x->top < 0);
    }
    
    /*Pops items from stack and prints them.*/
    void popprint(arraystack *x) {
    	int y;
    	/*Variable for loop.*/
    	int i;
    	/*If the stack is empty:*/
    	if (x->top < 0) {
    		/*Error.*/
    		printf("Stack is empty.\n");
    	}
    	/*Otherwise:*/
    	else {
    		/*New digit is popped and printed and stack top lowers by 1.*/
    		y = x->digits[x->top];
    		for (i = 0; i <= x->top; i++) {
    			printf("%d", y);
    		}
    		printf("\n");
    		x->top = x->top - 1;
    	}
    }
    
    /*Addition function.*/
    void addition(arraystack *x, arraystack *y) {
    	/*Variable for carry.*/
    	int carry = 0;
    	/*Variables for adding.*/
    	int num1, num2, sum;
    	/*Variable for printing.*/
    	int digit = 0;
    	/*While one stack is not empty:*/
    	while (x->top >= 0 || y->top >= 0) {
    		/*If first stack is empty:*/
    		if (x->top < 0) {
    			/*First addend is 0.*/
    			num1 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the first addend.*/
    			num1 = pop(x);
    		}
    		/*If second stack is empty:*/
    		if (y->top < 0) {
    			/*Second addend is 0.*/
    			num2 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the second addend.*/
    			num2 = pop(y);
    		}
    		/*Add num1, num2, and carry to get the sum.*/
    		sum = num1 + num2 + carry;
    		/*If sum < 10:*/
    		if (sum < 10) {
    			/*Carry = 0.*/
    			carry = 0;
    			/*Sum is pushed on the result stack.*/
    			push(&result, sum);
    		}
    		/*Else:*/
    		else {
    			/*Unit of result is pushed on result stack.*/
    			sum = sum % 10;
    			push(&result, sum);
    			/*Carry = 1.*/
    			carry = 1;
    		}
    	}
    	/*If carry is 1 after loop:*/
    	if (carry == 1) {
    		/*Push carry onto stack.*/
    		push(&result, carry);
    	}
    	/*Call popprint and send result.*/
    	popprint(&result);
    }
    
    /*Multiplication function.*/
    void multiplication(arraystack *x, arraystack *y) {
    	/*Variable for carry.*/
    	int carry = 0;
    	/*Variable for deciding factor.*/
    	int decide = 0;
    	/*Variable for loop.*/
    	int i;
    	/*Variables for product.*/
    	int num1 = 0;
    	int num2 = 0; 
    	int product;
    	/*Variable for printing.*/
    	int digit = 0;
    	/*While second stack is not empty:*/
    	while (y->top >= 0) {
    		/*Add the necessary zeros to first temp stack.*/
    		for (i = 0; i < decide; i++) {
    			push(&temp1, 0);
    		}
    		/*Dummy stack is equivalent to first value stack.*/
    		for (i = 0; i <= x->top; i++) {
    			dummy.digits[i] = x->digits [i];
    		}
    		/*Pop value from second value stack.*/
    		num2 = pop(y);
    		/*For the duration of dummy stack:*/
    		while (dummy.top >= 0) {
    			/*Pop value from dummy stack.*/
    			num1 = pop(&dummy);
    			/*Multipy numbers and add carry to get product.*/
    			product = (num1 * num2) + carry;
    			/*If product is less than 10:*/
    			if (product < 10) {
    				/*Carry equals zero.*/
    				carry = 0;
    				/*Product is pushed onto first temp stack.*/
    				push(&temp1, product);
    			}
    			/*If product is 10 or greater:*/
    			else {
    				/*Value of product % 10 is pushed onto stack.*/
    				product = product % 10;
    				push(&temp1, product);
    				/*Value of (product-(product%10))/10 becomes carry.*/
    				carry = (product-(product%10))/10;
    			}
    		}
    		/*If second temp stack is empty:*/
    		if (result.top < 0) {
    			/*Result stack is first temp stack.*/
    			for (i = 0; i <= temp1.top; i++) {
    				result.digits[i] = temp1.digits [i];
    			}
    			/*First temp stack is emptied.*/
    			temp1.top = -1;
    		}
    		/*Otherwise:*/
    		else {
    			/*Add two temp stacks together.*/
    			addformult(&temp1, &result);
    			/*First temp stack is emptied.*/
    			temp1.top = -1;
    		}
    		/*Add 1 to deciding factor.*/
    		decide = decide + 1;
    	}
    	/*Call popprint and print result.*/
    	popprint(&result);
    }
    
    /*Revised addition function for use with multiplication.*/
    arraystack *addformult(arraystack *x, arraystack *y) {
    	/*Variable for carry.*/
    	int carry = 0;
    	/*Variables for adding.*/
    	int num1, num2, sum;
    	/*Variable for printing.*/
    	int digit = 0;
    	/*While one stack is not empty:*/
    	while (x->top >= 0 || y->top >= 0) {
    		/*If first stack is empty:*/
    		if (x->top < 0) {
    			/*First addend is 0.*/
    			num1 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the first addend.*/
    			num1 = pop(x);
    		}
    		/*If second stack is empty:*/
    		if (y->top < 0) {
    			/*Second addend is 0.*/
    			num2 = 0;
    		}
    		/*Otherwise:*/
    		else {
    			/*Pop the second addend.*/
    			num2 = pop (y);
    		}
    		/*Add num1, num2, and carry to get the sum.*/
    		sum = num1 + num2 + carry;
    		/*If sum < 10:*/
    		if (sum < 10) {
    			/*Carry = 0.*/
    			carry = 0;
    			/*Sum is pushed on the result stack.*/
    			push(&result, sum);
    		}
    		/*Else:*/
    		else {
    			/*Unit of result is pushed on result stack.*/
    			sum = sum % 10;
    			push(&result, sum);
    			/*Carry = 1.*/
    			carry = 1;
    		}
    	}
    	/*If carry is 1 after loop:*/
    	if (carry ==  1) {
    		/*Push carry onto stack.*/
    		push (&result, carry);
    	}
    	/*Send result to multiplication.*/
    	return &result;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help Me With This Code Of Implementing Stacks
    By raghu_equinox in forum C Programming
    Replies: 3
    Last Post: 10-19-2006, 07:22 AM
  2. ...multiplication using stacks
    By iiwhitexb0iii in forum C Programming
    Replies: 1
    Last Post: 10-09-2006, 01:28 AM
  3. Avioding Stacks
    By LoafOfBread34 in forum C++ Programming
    Replies: 8
    Last Post: 12-08-2004, 06:20 AM
  4. Dumping singly linked list into 2 stacks.
    By strotee76 in forum C++ Programming
    Replies: 5
    Last Post: 05-16-2004, 05:48 PM
  5. Stacks stacks stacks
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 06-06-2002, 02:01 AM