419 Posted Topics

Member Avatar for uNpReDiCtAbLe

Everything seems fine except your prime number checker. Check this thread [URL="http://www.daniweb.com/forums/thread224686.html"]here[/URL] Check out firstPerson's function within his post.

Member Avatar for sfuo
0
136
Member Avatar for jdub69420

I would make the checkGuess() take in 2 integers that the user inputs with cin ( int num, denom ) and then compare it to the reduced fraction in f3. [CODE]int num, denom; cout << "num: "; cin >> num; cout << "denom: "; cin >> denom; f3.checkGuess(num, denom);[/CODE] The …

Member Avatar for StuXYZ
0
128
Member Avatar for julia2009

When I made my "Tile" game I ran into the same problem. I had a class called Tile and it held information for 1 square. Then I had a class called Board and this had a vector of Tiles within it. The problem that I had was that if I …

Member Avatar for StuXYZ
0
199
Member Avatar for calleriq

First off, when you post in the future you should use the code tags to make it way easier to read. Last time I checked your main() function has to return an int and you have it as a void function. [CODE]void main (void) { mainProgram(); }[/CODE] I don't know …

Member Avatar for Nick Evan
0
151
Member Avatar for scantraXx-

[QUOTE]1. When I insert elements into the vector, I cannot insert an element higher than 1.. only 0's and 1's.[/QUOTE] What is DEFAULTSIZE set to because if it is 1 then yeah 0s and 1s are within the range you set in your if() statement. [QUOTE]2. When I dump the …

Member Avatar for Alex_
0
165
Member Avatar for VuongGAD

This seems like a pretty bad homework assignment seeing how you can only use a few coins to get 10000 dongs. This is what I put together really quick. It's not done you need to come up with an output and you might wanna double check to see if the …

Member Avatar for sfuo
0
113
Member Avatar for sfuo

Hey I was wondering how the string class is able to output its self the way it does. For example: [CODE]#include <iostream> #include <string> using namespace std; int main() { string testString; testString = "Hello"; cout << testString << endl; system("PAUSE"); return 0; }[/CODE] If I were to try to …

Member Avatar for mrnutty
0
252
Member Avatar for Wolf CCMLG

You can use this to encrypt your string. [CODE]void EncryptableString::encrypt() { for( int i = 0; i < content.length(); i++ ) { if( (content[i] >= 'a' && content[i] < 'z') || (content[i] >= 'A' && content[i] < 'Z')) { content[i] += 1; } else if( content[i] == 'z' || content[i] …

Member Avatar for Alex_
0
904
Member Avatar for CrAzD

OK so I wrote out all your code into a new project and since this is just a short example I am going to give you what I got. [CODE]#include <iostream> #include <string> using namespace std; struct weapons { string name; int str; }; struct user { string name; int …

Member Avatar for CrAzD
0
119
Member Avatar for complexcodes

What does your maze look like? You just give the start and finish points.

Member Avatar for sfuo
0
109
Member Avatar for CD-4+

Just add [CODE]cin.ignore();[/CODE] at the bottom of your for() loop for input and this will ignore the '\n' character from the last cin. Also it looks like you do not have [CODE]#include <iostream> [/CODE] at the top of your file for cin and cout usage.

Member Avatar for mrnutty
0
157
Member Avatar for vatsa.devil

Most programs do their actions on key up. A way around this is to make a bool variable and make a KEY_UP if() statement. For example: [CODE] bool upKey; if( KEY_DOWN(VK_UP) && !upKey ) { upKey = true; //actions } if( KEY_UP(VK_UP) ) { upKey = false; }[/CODE] I'm not …

Member Avatar for sfuo
0
229
Member Avatar for yonghc

I'm not 100% sure what you are asking is this correct? [CODE]#include <iostream> #include <string> using namespace std; int main() { string arrcon[2]; arrcon[0] = "John"; arrcon[1] = "56"; for( int i = 0; i < 2; i++ ) { cout << arrcon[i] << endl; } system("PAUSE"); return 0; } …

Member Avatar for yonghc
0
409
Member Avatar for Mafia619

I have looked over the code and got it working. However, I guess I cannot post the code or I could lose reputation. The big thing I you should do is reread your code because I found lots of typos and missing statement endings '}'. Also, take a look at …

Member Avatar for sfuo
0
280
Member Avatar for Supercharger

Here is what I came up with. "mystuff.h" [CODE]#ifndef MYSTUFF_H #define MYSTUFF_H void randomize(); int random( int high, int low = 0); int getMax( int A[] ); int getMin( int A[] ); int swap( int A[] ); #endif [/CODE] "mystuff.cpp" [CODE]#include <time.h> #include <stdlib.h> #include "mystuff.h" void randomize() { srand(time(NULL)); …

Member Avatar for dgr231
0
156
Member Avatar for Warcat

I would put a while() loop with a bool variable in it [CODE]while(!done)[/CODE] and every time you win a point you add 1 to your score and 1 to the computers score when he wins. When one of the scores reach 2 then just make done = true and the …

Member Avatar for sfuo
0
113
Member Avatar for NinjaLink

First off, I think you are missing a semicolon at the end of your SavingsAccount class (line 14, Account.cpp). For your withdraw and deposit functions you could use: [CODE] ///savings class void SavingsAccount::withdraw(double amount) { balance -= amount*(1+WITHDRAW_FEE); } void SavingsAccount::deposit(double amount) { balance += amount; } //checking class void …

Member Avatar for NinjaLink
0
250
Member Avatar for shilpa_B

Why are you using a multidimensional array? If you explain a bit more stuff I might be able to help.

Member Avatar for shilpa_B
0
95
Member Avatar for sfuo

Hi I have been trying for a while to make a win32 app client be able to talk to a server app that I put on my friends computer. I am not 100% sure if the problem is caused by the fact that I have two routers which may interfere …

Member Avatar for sfuo
0
171

The End.