I'll give the if's a try again...didn't have any luck last time, but I'll give it a shot.
Thanks
Type: Posts; User: liquidspaces
I'll give the if's a try again...didn't have any luck last time, but I'll give it a shot.
Thanks
for(i=1; i<=3; i++)
{
for(j=1; j<=4; j+=i)
{
cout<<i<<endl;
}
}
So there is...seems I missed a brace and forgot that another function was necessary for compilation.
Am I returning true and false correctly to main? I'm really not sure if the way I'm doing it...
I have no idea what you're asking, but you put a for loop inside a for loop like this:
for(i = value; i < anotherValue; i++)
{
for(e = value; e < anotherValue; e++)
{
...
Crap...you can't compile that without the input and output files. I can post them if you like, though I'd hate for you to have to do that much work. A quick glance-over will be just fine:)
Thanks,...
Maybe the problem isn't with this switch...
I've been playing with this thing for the past 9 hours so I'm going to go ahead and post a very simplified version of main() and 2 other necessary...
I tried the cout << managePassage, and found something very strange.
When I do it before the while loop to display its initial value after calling the function it equals 0. However, when I call...
I'm not sure what I'm doing wrong, but I know that something isn't right.
managePassage is of type bool. A value, either true or false is returned by the called function. fileIn and fileOut are of...
Unfortunately, those options are out of the question. I definitely don't want to do it this way, but for this assignment my professor created the function prototypes and I have to figure out how to...
I'm working on a project for school, and have a question. For the sake of clarity, let's say I have two functions:
1. int main() //reads a word from file
2. void ReadFile() //stores contents of...
Great, thanks for all your help. It's the little things like this that really make me better.
Ok, I understand I think. Just to make sure I understand though, the statement:
if (myFile.fail())
{
//code
}
Will work fine on its own, but when used in the context of a loop it must...
That's strange...how can it find EOF if it can't even open it?
Great, thanks! This is why I'm always so nervous about writing my own functions to do these things...it's usually already done for me.
Thanks again,
Kevin
I figured it out a couple days ago...turns out you can pass a variable of type ifstream or ofstream, but you must use reference parameters in the functions you're passing to instead of value...
I've tried a variety of B.S. ways that I concocted to try and check if a file is opened after I try to open it. A couple of them work, but it's really sloppy code and probably uneccessary. Is there a...
That will work the first time, but in a lengthy document with many different tags wouldn't it execute the title tag each time since 't' is always the 2nd character?
Is there a solid way to declare input/output globally? I tried it a few ways and just got runtime compiler errors...
I'll give the while thing a shot, but let me explain why I'm doing the
input >> character; at the beginning of the functions:
I use main to figure out if there is a '<' and if there is I pass it...
Ok, so I'm writing a text preprocessor which seems pretty easy...identify certain tags from a source file and format the output file accordingly.
Basically it's supposed to work like this: The...