537 Posted Topics

Member Avatar for lotsofsloths

here was my attempt at writing tic-tac-toe maybe it will give ye' some ideas: [url]http://flashdaddee.com/forum/showthread.php?t=50[/url]

Member Avatar for Lazaro Claiborn
0
321
Member Avatar for spry
Member Avatar for revenge2

Learn the basics of windows programming [URL="http://www.winprog.org/tutorial/index.html"]http://www.winprog.org/tutorial/index.html[/URL]

Member Avatar for Ancient Dragon
0
122
Member Avatar for megabutt
Member Avatar for fesago90

Here is one easy method: [code] for(int i=0; i<People.size(); i++) { if(People[i].name == target) { cout << "Person Found: " << People[i].name << People[i].street << People[i].city << People[i].zip ; } }[/code]

Member Avatar for Dave Sinkula
0
5K
Member Avatar for Clinton Portis

I need a little help calculating odds for a roulette game.. i'm not sure why someone would bet 1:1 odds.. to me, that just means you win your money back without making a profit. also, 1:1+bet back doesn't seem any different than betting 2:1.. this is how I calculate it: …

Member Avatar for Bench
0
343
Member Avatar for gemacjr

[code] #include<iostream> #include<string> using namespace std; string char_to_string(char source[]); int main() { string full_name; char first_name[20]; char last_name [20]; cout << "\n\nEnter First Name: "; cin.getline(first_name, 20); cout << "\n\nEnter Last Name: "; cin.getline(last_name, 20); full_name = char_to_string(first_name); full_name += " "; full_name += char_to_string(last_name); cout << "\n\n\nYour full name …

Member Avatar for may4life
0
78
Member Avatar for Luwigie

You have done everything right thus far.. the only thing you haven't done, is to provide "function definitions" for your functions. Below your main( ), go ahead and right up what each function is supposed to do. Here is some pseudo to get ye' started: [code] void getData(menuItemType menu[]) { …

Member Avatar for Luwigie
0
170
Member Avatar for Lutzee

have you created an object from your class? is "f" a public.. or private class member? ;) post ye' code and we can help more.

Member Avatar for Salem
0
124
Member Avatar for FireSBurnsmuP

According to [URL="http://www.cplusplus.com/ref/iostream/istream/getline.html"]http://www.cplusplus.com/ref/iostream/istream/getline.html[/URL], the two acceptable forms of cin.getline() are: [code] istream& getline (char* s, streamsize n ); istream& getline (char* s, streamsize n, char delim );[/code] Both versions expect a char pointer as the first argument.. not a string class object. Luckily, string class objects contain a method that …

Member Avatar for WolfPack
0
153
Member Avatar for taruj83

[quote] y = 5 + 2b; and gives out the output y = 5 + 2b[/quote] hmm.. this is wicked easy [code] cin >> expression; cout << expression; [/code]

Member Avatar for iamthwee
0
98
Member Avatar for dhruvisinha
Re: Help

what code have you attempted thus far..? where are you encountering difficulty in writing this program?

Member Avatar for andor
0
97
Member Avatar for Clinton Portis

I am writing a simple program.. enter first and last name and a search is performed.. and their phone number (if found) is returned. I have used vector class iterators before a couple of times.. but devcpp does not seem to like this code.. and stops compilation somewhere inside of …

Member Avatar for iamthwee
0
127
Member Avatar for Clinton Portis

I have an operator overloading question... I have attempted to overload the >> operator so I can read a file directly into a "SongInfo" object, and attempted to overload the << operator so I can display a "SongInfo" object directly to dos console. When attempting to compile, I recieve, "overloaded …

Member Avatar for Clinton Portis
0
128
Member Avatar for HelmsK85

To get ye' started, here is how to create an array and store the first 100 multiples of a number into that array (assuming that no number in the array exceeds the bounds of the datatype size int ) [code] int array[100] ; cout << "Enter a number: " ; …

Member Avatar for Salem
0
127
Member Avatar for codergem

Here is one idea using the post increment operator: [code] int a, b; cout << "\nEnter first number: "; cin >> a; cout << "\nEnter second number: "; cin >> b; for (int i = 0; i < a; i++) b++; cout << "\nThe answer is: " << b; [/code]

Member Avatar for iamthwee
0
287
Member Avatar for degamer106

I think the theory behind using while loops in linked list traversal.. goes something like this: 1. check the head pointer... if(head_ptr) then x = head_ptr ; 2. now.. assign the head_ptr to x, x = head_ptr; 3. x now points to the first node of the list. 4. traverse …

Member Avatar for Drowzee
0
101
Member Avatar for DotNetUser

[code] struct Record { string title; int playtime; Record *next; }; Record **ListOfRecords = new Record*[42]; [/code]

Member Avatar for Ancient Dragon
0
124
Member Avatar for Tiffiney_v24

Here is a possible answer [u]without[/u] using a Class.. you can use the algorithm(s) below when you put together your class in your program. [code] #include <iostream> using namespace std ; int main() { int score[i], total = 0 ; for(int i=0; i<10; i++) { cout << "\nEnter an integer: …

Member Avatar for iamthwee
0
160
Member Avatar for degamer106

hmm.. try this: [code] for (cnt = 0; cnt < TOTAL; cnt++) { die1 = rand() % 6 + 1; die2 = rand() % 6 + 1; sum = die1 + die2; [b]++array[sum-2];[/b] }[/code]

Member Avatar for degamer106
0
115
Member Avatar for Duke_0064

[code] else if (guess = num) [/code] should be: [code] else if (guess == num) [/code]

Member Avatar for Duke_0064
0
107
Member Avatar for fitfool

[code] #include<iostream> #include<ctime> using namespace std; int main() { int number = 0, guess = 0; bool again = true; char answer; srand(time(NULL)); do{ number = rand()%3 + 1; cout << "\n\tGuess a number from 1 to 3: "; cin >> guess; while(again) { if(number == guess) { cout << …

Member Avatar for Bench
0
73
Member Avatar for crestaldin

Here is one method you could use to sort your linked list alphabetically: (I haven't tested this specific code but the idea is sound) First, push each node into an array of nodes: [code] Node **array = new Node*[size]; Node *temp = head_ptr; while(temp) { Node[i] = temp; temp = …

Member Avatar for Nedals
0
5K
Member Avatar for supes32

I had a little trouble with linked lists when I was learning.. so I whipped up a little something to get you started: [code]#include<iostream> #include<fstream> #include<sstream> #include<cstdlib> #include<iomanip> #include<cctype> #include<string> #include<windows.h> using namespace std; struct Node { string name; double cost; int quantity; Node *next; }; class Soda { public: …

Member Avatar for iamthwee
0
210
Member Avatar for hak
Member Avatar for rgrwalker

[code] class Fractions { public: //class constructor Fractions( ); //overloaded operators Fraction operator+(const Fraction &rhs); Fraction operator-(const Fraction &rhs); Fraction operator/(const Fraction &rhs); Fraction operator*(const Fraction &rhs); //other void print( ); private: int numerator; int denominator; }[/code] [u][URL=http://cplus.about.com/od/beginnerctutorial/l/aa101402b.htm]This[/URL][/u] is about all the help I can give ye' for now.. Above …

Member Avatar for rgrwalker
0
181
Member Avatar for niceguy21
Member Avatar for l-o-s-t

[code]int blah (Treep *tree);[/code] I think the data type you are attempting to pass is incorrect.. you should be passing in an object of type, "node" [code]int blah (node *tree);[/code] please post compiler errors for more assistance.

Member Avatar for l-o-s-t
0
259
Member Avatar for caseg
Member Avatar for Narue
0
197
Member Avatar for TimC

This is what I am thinking... Your loop condition is based on a=1 and will increment while a < size()+1. [code] for(int a=1;a<(S.size()+1);a++)[/code] But my guess is.. your linked list is "zero based".. much like how an array is.. which would account for why all other elements would be deleted.. …

Member Avatar for TimC
0
189
Member Avatar for guideseeq

C++ was invented by Bjarne Stroustrup, a professor at Texas A&M. It evolved from the C language.. and was originally referred to as, "C with Classes." The International Standards Organization now governs the c++ language. [URL=http://www.research.att.com/~bs/omo_interview.html]Here[/URL] is a good interview with Bjarne that will answer a lot of ye' questions. …

Member Avatar for perniciosus
0
456
Member Avatar for micropower99

free webhosting is good.. howev3r, I think that when it comes to the highest quality assignments done fast.. I think a nominal $$$ will get you what you want in this case.. ;)

Member Avatar for SpS
0
216
Member Avatar for atrusmre

[QUOTE=atrusmre]Got anything a little easier? :)[/QUOTE] How about this: [code] #include <windows.h> #define ID_LIST 1 #define ID_TEXT 2 /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */ char szClassName[ ] = "ComboBox App"; int WINAPI WinMain (HINSTANCE …

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

Having troubles handling text from a multiline edit box.. the first part of this algorithm runs fine by itself.. the second part (highlighted in blue) runs fine as a DOS console project using 'char' data types.. but when I add it to this windows project (using TCHAR's) it distorts the …

Member Avatar for WolfPack
0
686
Member Avatar for ninja sense

Is this your entire code..?? if so, it has some serious issues.. like missing header files.. and missing main( ) function... if not, you should always check to see if your file was opened correctly.. could use if( instream_object.fail( ) ) cout << "file open failure!"; also.. I have a …

Member Avatar for ninja sense
0
255
Member Avatar for dav83

sounds like you are on the right track.. counting the number of spaces is probably the easiest way to calculate the number of words in a file.. but as you have already identified.. one could run into trouble if there are multiple spaces in between words.. so why not identify …

Member Avatar for dav83
0
212
Member Avatar for Clinton Portis

Trying my hand at extracting user entered data from a multiline edit box... my strategy is to first, get the number of total lines from the edit box.. and the length of each line from the edit box.. and create a dynamic 2D array that is NULL terminated at the …

0
171

The End.