Forum: C++ Mar 3rd, 2006 |
| Replies: 5 Views: 1,536 You're treating deck[i] like a pointer when it's not. |
Forum: C++ Feb 8th, 2006 |
| Replies: 4 Views: 6,029 #include <iostream>
#include <sstream>
using namespace std;
int main()
{
int a =23545;
ostringstream o;
o<<a;
cout<<o.str().size()<<endl;
return 0; |
Forum: C++ Jan 26th, 2006 |
| Replies: 13 Views: 5,651 http://www.delorie.com/djgpp/v2faq/faq22_25.html |
Forum: C++ Jan 25th, 2006 |
| Replies: 13 Views: 5,651 Also, main really should return an int. |
Forum: C++ Jan 21st, 2006 |
| Replies: 4 Views: 1,707 trade(word[i]) != '\n' || i < 5)
(don't you want && i< 5 ) |
Forum: C++ Jan 17th, 2006 |
| Replies: 5 Views: 1,233 add a 'using namespace std' at the top and see if it makes a difference. |
Forum: C++ Dec 18th, 2005 |
| Replies: 13 Views: 15,963 http://www.daniweb.com/techtalkforums/showthread.php?t=36339 |
Forum: C++ Dec 17th, 2005 |
| Replies: 7 Views: 1,655 You don't need pointers here at all to begin with, if you are predetermining your maximum number of doctors at 5. (Also, if you are asking for 5 doctors, why are you only looping from 0 to 2? You... |
Forum: C++ Dec 16th, 2005 |
| Replies: 7 Views: 1,655 Also, anything you create with 'new' needs to be 'deleted' |
Forum: C++ Dec 13th, 2005 |
| Replies: 11 Views: 1,855 Sorry, displayMenu.h and menu.h |
Forum: C++ Dec 12th, 2005 |
| Replies: 11 Views: 1,855 This wouldn't surprise me either as for example you have more than one .h file with the same function:
int main_menu() ( in menu.h and displayMenu.h) |
Forum: C++ Dec 11th, 2005 |
| Replies: 3 Views: 4,494 Check that you aren't missing a } or have 2 }} when you should only have 1. I've had silly errors like that give me hundreds of compiler errors.. |
Forum: C Dec 4th, 2005 |
| Replies: 5 Views: 1,884 Does your filename or path contain a space? If so, make sure to pass it inside double quotes... |
Forum: C++ Dec 4th, 2005 |
| Replies: 4 Views: 1,734 Tim,
As I mentioned in my email, you've got to make this question a lot clearer.... |
Forum: C++ Dec 3rd, 2005 |
| Replies: 2 Views: 2,864 http://www.cprogramming.com/tips/showTip.php?tip=42&count=30&page=0 |
Forum: C++ Aug 15th, 2005 |
| Replies: 4 Views: 4,690 Not sure about linux, but on solaris, you need to update your LD_LIBRARY_PATH environment variable to include the directory with the shared objects you want to load... (and on AIX, it's LIBPATH)...... |
Forum: C++ Jul 17th, 2005 |
| Replies: 13 Views: 86,689 I know what you mean...
By the way, no need to quote the entire previous posting when putting a reply (only the relevant piece).. |
Forum: C++ Jul 16th, 2005 |
| Replies: 13 Views: 86,689 So Picky ;). As you wish:
#include <iostream>
using namespace std;
void prime_num(int);
int main()
{
cout << " Enter a number and I will generate the prime numbers up to that number: ";
int... |
Forum: C++ Jul 16th, 2005 |
| Replies: 13 Views: 86,689 Here's what I went with. Note you want to do a break if you find out it's divisible as there is no point in checking all the numbers beyond it for divisibility..
#include <iostream>
using... |
Forum: C++ Jul 9th, 2005 |
| Replies: 14 Views: 2,338 Did you copy and paste what dave wrote and compiled it? |
Forum: C Jun 8th, 2005 |
| Replies: 12 Views: 47,941 you can do this:
char temp[10];
int num = 3;
sprintf( temp, "String%d", num); |
Forum: C Jun 8th, 2005 |
| Replies: 12 Views: 47,941 gebbit, you can also look into sprintf, which gives you a lot of options. |
Forum: C Jun 7th, 2005 |
| Replies: 9 Views: 60,669 OK, but why the for loop? You only want the user input once correct? |
Forum: C Jun 7th, 2005 |
| Replies: 9 Views: 60,669 A couple of things:
First, you need to include "stdlib.h" for atoi. (Note, I think atoi is not standard, consider sprintf)
Second, you are trying to get the length of an integer (... |
Forum: C++ May 23rd, 2005 |
| Replies: 2 Views: 1,446 I don't see the need for "\n" on this line...
cin >>typed_choice>> "\n"; |