Posts
 
Reputation
Joined
Last Seen
Ranked #174
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
84% Quality Score
Upvotes Received
133
Posts with Upvotes
112
Upvoting Members
66
Downvotes Received
22
Posts with Downvotes
18
Downvoting Members
17
37 Commented Posts
~272.27K People Reached
About Me

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
Favorite Tags

537 Posted Topics

Member Avatar for coldkiller

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 …

Member Avatar for Hariharan_1
1
7K
Member Avatar for restrictment

That looks like quite a time investment.. cool ascii art too. How long did all this take you..??!?

Member Avatar for emeraldamerican
0
6K
Member Avatar for sheltask

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 …

Member Avatar for Less_1
1
832
Member Avatar for jcAmats

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 …

Member Avatar for zia shaikh
0
1K
Member Avatar for snehil_khanor

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]

Member Avatar for dessy_1
0
3K
Member Avatar for arguav74

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 …

Member Avatar for Schol-R-LEA
0
1K
Member Avatar for SolidSora
Member Avatar for Mahfuz_1
0
320
Member Avatar for Shinedevil

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 …

Member Avatar for Mahfuz_1
0
399
Member Avatar for aramil daern
Member Avatar for Echo89
1
485
Member Avatar for BevoX

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 …

Member Avatar for Microno
1
678
Member Avatar for Riteman

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, …

Member Avatar for angham kh
0
4K
Member Avatar for steveaustin

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( ) ; …

Member Avatar for dagurr
0
708
Member Avatar for kusel1030

[code] string lines[69]; int i=1; while(getline(infile, lines[i])) { i++; }[/code]

Member Avatar for omarelbeik
0
252
Member Avatar for kisseric

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!)

Member Avatar for manujkathuria
-4
1K
Member Avatar for logicmonster

[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 …

Member Avatar for lance p
0
311
Member Avatar for Clinton Portis
Member Avatar for Nick Evan
0
166
Member Avatar for henri18

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 …

Member Avatar for Lerner
0
484
Member Avatar for Zemorg

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 …

Member Avatar for Clinton Portis
0
1K
Member Avatar for infogirl

//Dynamic 2D memory allocation float* matrix = NULL; float** userMatrix = new matrix*[10]; for (int i=0; i<10; i++) { *userMatrix[i] = new matrix; }

Member Avatar for mrnutty
0
152
Member Avatar for niceyout

> 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] …

Member Avatar for niceyout
0
169
Member Avatar for nekoleon64
Member Avatar for Clinton Portis

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 …

Member Avatar for PrimePackster
0
1K
Member Avatar for vissure
Member Avatar for naraayanan
Member Avatar for Captain Neo

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]

Member Avatar for PrimePackster
0
181
Member Avatar for Dman01

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'.

Member Avatar for Dman01
0
257
Member Avatar for mustad104

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 …

Member Avatar for Clinton Portis
0
737
Member Avatar for KingAudio

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. …

Member Avatar for richieking
0
135
Member Avatar for ahoysailor

[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 …

Member Avatar for Clinton Portis
0
181
Member Avatar for mncoc

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.

Member Avatar for mncoc
0
164
Member Avatar for PeTo.

it's pretty easy to do.. just compare the number you with every occupied element in the array. if it is not in the array, add to array. else, try again.

Member Avatar for adityatandon
0
2K
Member Avatar for Clinton Portis

[code] #include <iostream> int main() { std::cout << "Merry Christmas Everyone!"; return 0; }[/code]

Member Avatar for mrnutty
3
116
Member Avatar for TheFearful

not only do you want numbers 10 thru 30, you want unique (non-repetitive) numbers. so this is how ye' can go aboot' it: [CODE] int random = 0; int numbers[69]; bool is_included(int numbers[], int); srand(time(NULL)); for(int i=0; i<=amount_requested; i++) { //pick a random number in the range ye' desire random …

Member Avatar for Clinton Portis
0
175
Member Avatar for Desh2350

your assignment is very easy. i could write it in less than 5 minutes. please excerpt some sort of effort... peace out yo.

Member Avatar for Desh2350
0
452
Member Avatar for jeevsmyd

Here is a c++ solution: [code] #include<fstream> #include<iostream> #include<string> #include<vector> using namespace std; bool is_label(string); bool is_operand(string); struct line_obj { string label; string opcode; string operand; }temp; vector<line_obj> text_file; string word; ifstream infile("inputfile2.txt"); if(infile.is_open()) { cout << "\aFile failed to open."; cout << "\nFile may have been moved, renamed, or …

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for misalazeem

I think you'd have to first check to see if there are any possible moves your king can make... and then if the attacking piece is not a knight, you will probably have to check every other piece on the board to see if it can move anywhere inside the …

Member Avatar for arkoenig
0
2K
Member Avatar for sangkun

[code] string s("augcuuaucaca"); string temp; int size = s.size(); int pos = 0; vector<string> list; do{ try { temp = s.substr(pos, 3); list.push_back(temp); pos += 3; } catch(out_of_range) { break; } }while(pos != size);[/code]

Member Avatar for Clinton Portis
0
179
Member Avatar for sodha125
Member Avatar for Chuckleluck
0
2K
Member Avatar for Akusa

what you are trying to do is suprisingly not that difficult. this type of ascii game will involve some simple techniques. in any animated ascii game, it's just a matter of clearing and re-drawing the screen. you will need simple collision detection to tell when you've hit the enemy. you've …

Member Avatar for Schol-R-LEA
0
429
Member Avatar for Hiiero

in order to avoid repetition, you will have to push skills you have selected into an array, and compare the contents against future randomly generated skills. if skill has been used, try again.

Member Avatar for Hiiero
0
147
Member Avatar for ayaya3523
Member Avatar for midgarsorm

what i would do in this situation is read in the entire line using getline(), and then break the line down and store it as you desire. here is a possible pseudocode: 1) read in the entire line 2) based on your text file format, we can assume the first …

Member Avatar for Clinton Portis
0
158
Member Avatar for Zssffssz
Member Avatar for Clinton Portis
0
93
Member Avatar for sita12345

[CODE] struct object { char beer; }temp_object; for(int i=0; i<69; i++) { temp_object.beer = value; my_vector.push_back(temp_object); } //now change it for(int i=0, size=my_vector.size(); i<size; i++) { my_vector[i].beer = another_value; }[/CODE]

Member Avatar for Clinton Portis
0
124
Member Avatar for Thug_life

I tried to give ye' some guidance with pseudocode... but trying to explain the loop conditions and array indicies seemed to be awkward and would have only added to your confusion. So I will give you one free of charge. Give the other 2 problems a chance on your own …

Member Avatar for Clinton Portis
0
104
Member Avatar for nubcoder

with limited knowledge of your problem combined with other generalities (such as your 'for loop') one guess i would make is that your loop condition in line #12 seems suspicious. since array elements are zero based, it is somewhat uncommon to see size-1 as a loop condition. this could cause …

Member Avatar for nubcoder
-1
129
Member Avatar for iwlc

If ye' have a windows operating system ye' can do this: [CODE] include <windows.h> void set_console_size() { HANDLE hOut; SMALL_RECT DisplayArea = {0, 0, 0, 0}; //set x and y to whatever ye' want int x = 125; int y = 55; hOut = GetStdHandle(STD_OUTPUT_HANDLE); DisplayArea.Right = x; DisplayArea.Bottom = …

Member Avatar for vijayan121
0
3K
Member Avatar for bwilson1

you have the function [icode]double getInput(double[],int);[/icode] to accept a double array; however, in line #28 you are attempting to pass in a double var. one solution could be to overload the getInput() function so you would have a version of the function that would accept a double, and one version …

Member Avatar for MandrewP
0
122
Member Avatar for Navlag

i suspect the problem might be file i/o related; however, i do not see any file i/o at all. i suspect these operations occur in the getblock() function (and it's variants) but I am not sure. one thing i would recommend though, is if you are attempting to use a …

Member Avatar for Navlag
0
269
Member Avatar for suiram

since you have a known format with with data separated by white spaces, we can create an object to hold each line from the text file: [CODE] struct account { //string string char int double string string first_name; string last_name; char m_f; int age; double balance; string address; };[/CODE] Now …

Member Avatar for Clinton Portis
0
258

The End.