It's been a while since I've been out here, volk, but a reasonably good response to your question can be found in Scott Meyers' book, Effective C++.
Unless you're writing a paper, or something of...
Type: Posts; User: skipper
It's been a while since I've been out here, volk, but a reasonably good response to your question can be found in Scott Meyers' book, Effective C++.
Unless you're writing a paper, or something of...
I'm with PJ.
At this level, use find().
Also, investigate 'basic_string'. The member functions that you'll find will surprise/amaze you.
(Why they're not used more often is a mystery to me,...
Chris,
You should be eternally grateful for the help you've received here.
Between nextus and Speedy5 (nextus' code being more straightforward), your homework is done.
A simple 'copy &...
Still have your "triangle" code somewhere on a CD and I confess to doing some "scrambling" on that one. Very sweet.
This one's playing it a little "closer to the vest", though, isn't it? :)
Not...
Not to be a "wet blanket" here, folks, but this discussion might better be conducted on the General Discussion Board. ;)
-Skipper
Amy,
You need to do a program on prime factors?
Been done. Do a search. ;)
-Skipper
One possibility.
If your file was created as a char array rather than a pure 'string', there would be a trailing '\0' character, or characters. This, of course, would signify the end of the...
Sure.
The EOF flag is not turned "on" until after the last character of the file is read, hence, your 'problem'. In short, your WHILE loop is going through one additional iteration accounting...
Biographies/History.
I'm currently in the middle of Robert K. Massie's Peter the Great. Shameful that I waited this long to read it. Excellent.
(Okay, you "kids" can go back to sci-fi and...
Minesweeper,
I didn't see an answer to your question, so...
No, the Marine Corps is not the President's "personal army".
The Marine Corps, whether they like it or not, are subsidiary to the...
void main()?????
It's int main() and we leave it to you to discover why.
As Azuth points out, code tags. (Hammer will appear shortly...)
Up to me, and I had to use a 'switch' statement? I'd...
Research the standard 'string' class. There are a wide variety of 'find' and 'replace' member functions,as well as a 'swap' member function.
I was educated to the fact that binary files are...
The example your text illustrates is the language from which the 'shortcut' version that hk_mp5kpdw provided is derived.
Unless I'm mistaken, this is compiler-dependent, however. Borland supports...
alpha is right. ios::fixed is the key to your problem.
setprecision() has "default" settings which are fine as long as you understand how they function. (It doesn't discriminate between the...
Agreed. (However, not with the spelling. :) )
Switch statements work with integral values only. Doesn't mean they're not "variables".
Let's be careful of the 'basics'.
It's incumbent upon...
Agreed with OneStiff on this one.
May be a little too PC, but there are procedures, lest you end up sitting in an NLRB courtroom, or mediating with EEOC.
Garbage, of course, but real world.
...
Actually, it does run. Depends on your compiler, though. MSVC++ automatically stops at the end of the execution.
Borland, and others, need to be "forced" to stop with a "pause" statement of some...
Late in the game (so to speak):
The Great Escape
Enemy At the Gates
The American President
Fort Apache
Roman Holiday
Lawrence of Arabia
The Blue Max
Twelve O'Clock High
>I can't see the attraction in fighting in a jungle - or even a desert for that matter.
There is no attraction to war. Period. Two childhood friends were killed in Viet Nam. A couple of more got...
Fair enough.
(Told you, Prelude, but, noooo..."It's Christmas Eve, and not even I would be that 'nitpicky'!" Coal for Christmas, again! :D)
Sorry, Ride -or- Die, you're right, of course. I...
My understanding is that 18-year-old's must still register with the Selective Service Commission (does it still go by that name?). My son did three years ago, anyway.
As to the original question?...
Since handheld calculators were (literally) unheard of when I was in high school, I can't say that I can think of any programming teachers that were less-than-effective. (C++ was still on the drawing...
Somewhere in Mr. Stroustrup's book it's suggested that declaring of variables should be done as near as practicable to where the variable is used in the code.
Whether it lends itself to...
By way of information, a 'string' is a char array. Specialized, meaning more functional, but it's still a char array.
Research the member functions of the 'string' class (basic_string) to see what...
Sounds to me like you may be looking more toward a 'deque' than a vector since you may want to 'push' and/or 'pop' at either end. (You just knew someone would throw some garbage into the game, didn't...