ah, so i cant just do this in a different function, i have to modify the original class in order to access the private data
Type: Posts; User: 2fastwrx
ah, so i cant just do this in a different function, i have to modify the original class in order to access the private data
so...have a function that automatically pops off every node, then as it does, display it? i know youd have to set up a loop:
while node does not equal NULL
pop node
print node
...
yes, i know the latter topic is common. but theres a twist: a predefined class.
i have a predefined class for a stack that brings up a menu where you can push, pop, and peek. now i have to use...
that worked great. now to validate a float: i was thinking of a counter for the decimal points, in order to make sure more than one is not entered (not neccessary, but extra). i was gonna use a for...
wow. the code you use is a bit above me right now, but i appreciate the effort
eventually i found out that my logic operators were wrong, and all of my or's shoulda been and's...now i gotta figure...
grr!...now it doesnt work...
as soon as i changed
if (noErrors = true)
to
if (noErrors == true)
it spits out 'invalid input'....i dont get it...i corrected the '=', tested it and...
*slaps forehead*
ok, now....if you put in more than 9 characters, it loops infinitely with "invalid input", is there a way to write an if statement to stop this?
well heres the code:
#include <iostream>
#include <stdlib.h>
using namespace std;
bool ReadInt(int *value);
yup that fixed it...guess i had the code wrong cause the array wont multiply right, so i just did this
int total = randreturn * randreturn2;
if (answer == total)
cout <<...
oh i see...create an integer then assign the function return to it, then instead of displaying the return, display the new integer. blasted function calls...
thanks!
edit: well it compiles now,...
ok here goes...
#include <iostream>
#include <cmath>
#include<cstdlib>
#include<ctime>
using namespace std;
well...im trying to assign the outputs generated by rand () to a variable so that i can multiply them later. unfortunately, i keep getting 'intializing' errors regardless of whether i try to just...
gotcha...so my custom functions arent executed until main tells them to. and without the function call written correctly (using the name and arguments...must drill that into brain) the functions are...
ohhh, ok...tricky stuff...
so when i used 'if (remainder > 0)' it was just returning the result of the modulus, but instead i needed to call the actual function name.
alright, well thanks for...
im having problems with my function calls and relevant operators...ive been working on this for hours but i cant get the result of my function to be recognized by the main function. this is where im...