- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 133
- Posts with Upvotes
- 112
- Upvoting Members
- 66
- Downvotes Received
- 22
- Posts with Downvotes
- 18
- Downvoting Members
- 17
Have an AS in computer science... specializing in c++ and windows api. I am a machine gunner for the VA Army National Guard. I have a private pilot's license. I also like to play guitar. Also a fan of my hometown team, the washington redskins. I have…
- Interests
- Flying, programming, guitar
- PC Specs
- Gateway PentiumIV 400mhz bus 1gb DDRAM
Re: I am intruiged with this assignment.. although it's been years since I balanced a chemical equation.. I would find this to be a fun challenge. You teach me how to balance chemical equations.. I'll give you some code. Start me off with something simple.. and I'll code you an answer … | |
Re: That looks like quite a time investment.. cool ascii art too. How long did all this take you..??!? | |
Re: when it took me 6 months to figure out how to add basic resources to a win32 project.... and going through 5 compilers just to change window background color, i knew this **** was just to messed up. i'm glad i stopped at just c++ or else i would be … | |
Re: one thing is ye' need to call srand() somewhere in order to seed ye' random number generator. I would load your entire text file into a data structure, line by line, and then get lines out of the data structure at random. [code] vector<string> text_file; int line_counter = 1; string … | |
Re: You declare main() to return an 'int' type... but nowhere do you have a 'return' statement in your main() function. [CODE] int main() { ... ... yadda yadda .... ... etc etc. .... ... ... return 0; }[/CODE] | |
Re: I'll show you what I'd do, maybe it will give ye' some ideas on how to handle ye' problem: 1. Get a sentence to translate from the user [code] #include<sstream> #include<string> #include<iostream> #include<cctype> cout << "Enter sentence to translate to pig latin: "; cin >> user_input;[/code] 2. Parse the sentence … | |
Re: main() is prototyped to return an int, but returns nothing. | |
Re: When testing for primes, you only need to test half the range: [CODE] bool is_prime = true; cout << "Enter a numeral: "; cin >> number; if(number == 1 || number == 3) { cout << "Number is prime."; exit(0); } for(int i=2; i<number/2; i++) { //If there is any … | |
Re: the program does what you want it to do so it can't be all that bad. | |
Re: just out of curiosity i am trying to measure the performance of my basic algorithm vs. your algorithm... but i am having a math problem; for some reason I cannot peform this division: [code] seconds = (end-start) / CLOCKS_PER_SEC; [/code] i viewed the value of CLOCKS_PER_SEC as defined in the … | |
Re: this will create 12 "computer" objects and open 12 .txt files: [code] ifstream computers[12]; for(int i=1; i<13; i++) { string file("comp"); file += itoa(i); file += ".txt"; computers[i].open(file.c_str()); if(!computers[i].is_open()) { cout << "\a\nError, file #" << i << " unable to be opened!"; cout << "\nFile may be been moved, … | |
Re: Here is a little something to get ye' started: [code] #include<iostream> using namespace std; ////////// User Defined Abstract Data Types //////////// struct Record { int quiz_1 ; int quiz_2 ; int midterm ; int final ; } ; class Grade_Calculator { public: void menu( ) ; void add_a_record( ) ; … | |
Re: [code] string lines[69]; int i=1; while(getline(infile, lines[i])) { i++; }[/code] | |
Re: Talk about resurrecting the dead on Halloween.. never seen a post this old get bumped to the top in a long time (this thread originated back in 2004!) | |
Re: [code] //Provides ability to write to the dos console (cin/cout) #include<iostream> using namespace std; int main() { int input = 0; cout << "Enter t or f: "; cin >> input; do{ if(input == 't') { cout << "True"; } else if(input == 'f') { cout << "False"; } else … | |
have fun with this game o' keno! post here with your highest winnings | |
Re: in my opinion, you should write functions that evaluate everything from royal flush to high card: //function prototypes bool is_royal_fush(hand[7]); bool is_straight_flush(hand[7]); bool is_4kind(hand[7]); bool is_full_house(hand[7]); bool is_flush(hand[7]); bool is_straight(hand[7]); bool is_3kind(hand[7]); bool is_2pair(hand[7]); bool is_pair(hand[7); int get_high_card(hand[7]); Some hands might qualify for several winning scenarios, so it is important … | |
Re: I'm just briefly looking at your code, but is there any case where the size of s[i] would be less than 2? if so, you'd then be subtracting 2 and passing a negative value to substr(): `tmp[i].ID=s[i].substr(1, s[i].size()-2);` furthermore, your starting position is '1', so is there any case where … | |
Re: //Dynamic 2D memory allocation float* matrix = NULL; float** userMatrix = new matrix*[10]; for (int i=0; i<10; i++) { *userMatrix[i] = new matrix; } | |
Re: > Quoted Text Herehello i am creating a tictictoe game , however i cannot get the program to check if the player has won or not . and produce a you have won message void win_check(char Map[10]) { //Row checks for(int i=0; i<10; i+=3) { if(Map[i] == Map[i+1] && Map[i+1] … | |
Re: [code] int get_tiles(int& length, int& width){return length * width}[/code] | |
Fun game for the raging compulsive alchoholic gambler, such as myself. Although the game may vary among casinos, the basic premise is the user picks 10 numbers out of 80. The computer will randomly draw 20 numbers out of 80. If you matched with any of the computer picks, you … | |
Re: i like agressive RrrRRraawwrrrrr..... | |
Re: One problem may be that [I]you never initialized [U]any[/U] of your variables.[/I] [CODE] //These could literally be any value. int n,x,i,j;[/CODE] Here you create a variable 'j', and make a whole bunch of loop conditions that are based on 'j'... 'j' could be anything...... [CODE] for([B]j[/B]=(2*[B]j[/B]-1);[B]j[/B]>0;[B]j[/B]--)[/CODE] | |
Re: if the EOF flag is set and it's giving you problems with seekg(), try clear()'ing the object and see if that works for ye'. | |
Re: i've actually looked up youtube videos to teach myself this somewhat complex topic... never actually studies flow systems. i got the basic concept and can do some simple examples. i am down with your code, but i am not down with flow systems. if we put our heads together we … | |
Re: int types do not support floating point decimal. try using double types, and if you desire a set precision, you can go even further and use float's. with your calculator application, it is possible to prompt the user for a desired precision, in which case you would use float types. … | |
Re: [quote]so can only search for the IDS_STRING part. How can I achieve that?[/quote] try a little somethin' like this: [code] vector<string> text_file; //load the vector........ //find substrings in your vector: for(int i=0, size=text_file.size(); i<size; i++) { if(text_file[i].substr("IDS_STRING") != string::npos) { //found } else { //not found } }[/code] [quote] I'm … | |
Re: I can give ye' some help with solving a quadratic equation in c++, but I have no help for ye' when it comes to MFC. I could even help you solve the equation symbolically as opposed to a close decimal approximation. |