Forum: C++ Jan 15th, 2008 |
| Replies: 2 Views: 2,981 Similar to:
http://www.daniweb.com/code/snippet176.html |
Forum: C++ Jan 15th, 2008 |
| Replies: 2 Views: 2,928 Similar to:
http://www.daniweb.com/code/snippet569.html |
Forum: C++ May 24th, 2007 |
| Replies: 1 Views: 2,872 Very nice example of switch case! |
Forum: C++ May 24th, 2007 |
| Replies: 4 Views: 12,306 Why are you using the C snippets for a C++ snippet? There is a difference between the two old languages. |
Forum: C++ Apr 22nd, 2007 |
| Replies: 14 Views: 2,489 Code tags won't help here! I guess in some countries April first falls on a later date! This code has only one purpose, to test the mental constipation of the typical C programmer. |
Forum: C++ Feb 9th, 2007 |
| Replies: 4 Views: 904 VB.NET followed by VC.NET and possibly VD.NET? My soothing condolence! |
Forum: C++ Feb 9th, 2007 |
| Replies: 14 Views: 2,222 Frigg, I posted it and it got swallowed up.
An array of unions might do. |
Forum: C++ Feb 9th, 2007 |
| Replies: 10 Views: 5,623 Take you pick:
Unix OS is '\n'
Windows is '\r\n'
Mac OS is '\r' |
Forum: C++ Feb 8th, 2007 |
| Replies: 16 Views: 3,327 Our friend is on a Linux machine. |
Forum: C++ Feb 7th, 2007 |
| Replies: 11 Views: 2,335 Reading the books might help. |
Forum: C++ Feb 7th, 2007 |
| Replies: 16 Views: 3,327 The IT did not use C++ or she would still be working on it! |
Forum: C++ Dec 29th, 2006 |
| Replies: 5 Views: 1,502 Don't forget that an ace can be 1 or 11 |
Forum: C++ Dec 26th, 2006 |
| Replies: 5 Views: 11,610 Hmm, another Turbo C hold-over! You can replace it with the SetPixel() function from the Windows GDI32.lib. Vegaseat had plowed those fields long ago, and there is an example he left in the code... |
Forum: C++ Dec 26th, 2006 |
| Replies: 5 Views: 11,610 Ah, the old Turbo C bad habit clrscr() function. First try to make your program without it, it is rarely needed! You can replace one bad habit with another and use:
#include <stdlib.h>
void... |
Forum: C++ Dec 26th, 2006 |
| Replies: 6 Views: 1,660 I think that Dev C++ follows the standard better, since it really uses a very common open source compiler. A program should close unless you make it wait within the code. Anything else is added by... |
Forum: C++ Oct 10th, 2006 |
| Replies: 14 Views: 11,112 Why stick to Borland ??? Right on ~s.o.s~! Borland is a sinking ship!
The Visual Studio 2005 free edition is huge! Kind of takes over your computer. I would go for GCC which is part of the... |
Forum: C++ Oct 10th, 2006 |
| Replies: 10 Views: 8,644 If you use C++, load a string vector and use the vector's sort. Then you don't have to give a rat-poop about the sorting algorithm, it will be the best! A somewhat modern example:
// load a string... |
Forum: C++ Oct 8th, 2006 |
| Replies: 2 Views: 1,926 The rules of the Game of Life are wonderfully explained at:
http://www.math.com/students/wonders/life/life.html |
Forum: C++ Oct 7th, 2006 |
| Replies: 7 Views: 6,391 Here is a mildly more modern way:
// convert string to all lower case
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
using namespace std; |
Forum: C++ Apr 21st, 2006 |
| Replies: 5 Views: 2,224 // I think clock() is only available for Windows, a tick is ~ 1 ms
// if you need time like the string returned by ctime(), then you have to do some processing
#include <iostream>
#include... |
Forum: C++ Apr 21st, 2006 |
| Replies: 4 Views: 4,053 Sorry, I am on a borrowed computer. There is a code snippet here on DaniWeb that uses a BGI for C++. You may check the web site referenced in the snippet.
... |
Forum: C++ Mar 31st, 2006 |
| Replies: 2 Views: 1,037 Take a look at the C++ code snippets here on Dani Web. The snippets are in a goofy order, but you can search them.
This one might do for drawings:
http://www.daniweb.com/code/snippet176.html
... |
Forum: C++ Mar 31st, 2006 |
| Replies: 16 Views: 2,011 Okay children, stop the name calling!
grunge man, you forgot to iclude <iostream>
#include <cstdlib> // system()
#include <iostream> // cout, cin, endl
using namespace std;
int main()... |
Forum: C++ Mar 30th, 2006 |
| Replies: 20 Views: 3,451 I would set up a vector of doubles, load it with the resistance values using push_back(). This will take care of size too. You can load from a file or user input.
Now loop through the vector and... |
Forum: C++ Mar 29th, 2006 |
| Replies: 1 Views: 5,083 "Modify the program in Fig 2.21 so it uses only
integers for monetary values to calculate the compound
interest."
Why would you ever want to do that for? |
Forum: C++ Oct 22nd, 2005 |
| Replies: 2 Views: 2,388 Why not just google for it, it's so easy! |
Forum: C++ Sep 25th, 2005 |
| Replies: 7 Views: 2,828 The way I read this, this person wants to write a string about 20 to 30 lines long. Am I correct? How to do it best within the code is not an easy question to answer.
... |
Forum: C++ Sep 25th, 2005 |
| Replies: 13 Views: 2,674 However, there is a comparison operator out of sight! |
Forum: C++ Sep 16th, 2005 |
| Replies: 54 Views: 82,478 This site has a real thorough and updated list of books for C and C++
http://www.comeaucomputing.com/booklist/ |
Forum: C++ Aug 30th, 2005 |
| Replies: 8 Views: 4,145 JoBe, that looks like interesting code you doing! Is that STL stuff or what? |
Forum: C++ Aug 30th, 2005 |
| Replies: 1 Views: 3,308 Does anybody know if there is a good C++ code library that can process MIDI music files? |
Forum: C++ Aug 30th, 2005 |
| Replies: 7 Views: 14,315 Wow iamthwee, that must have taken some time to type in all those colors. I like colors! Are you a genius or something? |
Forum: C++ Aug 30th, 2005 |
| Replies: 7 Views: 14,315 A lot of schools have no money for their hand-me-down computers. Turbo2.0 is given away free. Still better than teaching Mbasic. |