oh gotcha, I was trying to store a true/false in the variable, but also in an array. I see what you mean about the array with no variables:
bool lights = {}; lights[1] = true;
Thanks!
Type: Posts; User: Brian_Jones
oh gotcha, I was trying to store a true/false in the variable, but also in an array. I see what you mean about the array with no variables:
bool lights = {}; lights[1] = true;
Thanks!
I'm trying to make an array that says true or false about a dining room and kitchen. I am familiar with int & char arrays, but not sure how to do a boolean one...
#include <iostream> ...
the example in the book doesn't have that. I looked at a different class example in the book and it has a few .cpp files. one is called a driver function and the other is called an implementation...
I'm trying to learn about "user defined classes" and don't understand what they're for. Once I see a project compile it seems to click with me so I typed up the source file and matching "user...
Thank you!
After searching the net for an hour to find a good random number generator, this is the best I found. From what I understand it works off of time as seconds and minutes change, but I would like to...
it's working good now, Thank you both!
its just the sample here that contains 4 characters on each line. The lengths are 4 & 6 digits long
at least I think it is called "clearing the buffer"...
so, this is a menu driven program. If the first option is chosen, you can input a number and it will store the number in a string. Then a...
thank you, found some good info on stringstreams and does exactly what I needed.
I'm trying to figure out a way to read in two values- one is a char and one is a string. I would like to pull the real number from the string if it is a real number.
basically if the string was...
Gotcha, that makes sense. I don't really have the know-how to integrate it into my code though.
I haven't used the notation of "std::istream like std::cin" because the way I was taught was to use...
well, I'm not sure how to use it. Haven't seen the (cin >> value) line before. I was thinking "value" was going to be a reserved word for filtering any number, but doesn't appear so.
I'm...
I'm trying to make a function work without the possibility of an infinite loop. The function has two inputs: an operator and one operand and returns a sum. The inputs would look like -8 or *7 for...
#include <iostream>
#include <iomanip>
using namespace std;
int i, j;
int main()
ahhh that last one made everything crystal clear. if there's a cin line, then the ints go into the last line where your Add(2, 3) is, but before they get displayed on that cout line, they go up to...
something finally clicked with me about recursive functions.
when it says "return a", it meant replace the whole "vax(int a, int b)" with just whatever the value "a" is. and that is why on the...
Thanks, that helped.
so, sounds like when
when function "int Min(int a, int b)"
is used, all that matters is what is in the first argument position"int a" when it comes to calling it down...
It looks like the "a" in the line "return a;" is the same number as the final integer.
if "a" was 21, "vax(int a, int b)" would be equal to vax(21,0). Somehow with function calls vax(21,0) equals...
ahhh function calls it is. I see it talked about in my books and on webpages, but it doesn't explain how it works. I don't see how "vax(int a ,0)" or abc(int y, int z) can equal an integer :/
I am trying to understand this function and I don't get how at the bottom of the function that "vax(a,b)" can equal just a single integer.
once "b" equals zero then vax(a,b) somehow equals an...
Looks like I have a lazy shift finger, I know to check for those now...
Thanks for your help :)
// File: stickFigure.cpp
// Draws a stick figure
#include <iostream>
using namespace std;
// Fucntions used ...
void drawCircle(); // Draws a circle
sorry, I probably didn't cut&paste enough error info.
I did forget the parentheses, now I understand what that sample meant, but for some reason it isn't wanting to work now that I fixed that....
cool, that made it go from 7 errors to only 1:
error C2470: 'drawTriangle' : looks like a function definition, but there is no parameter list; skipping apparent body
I googled error C2470 and...