Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

26 Posted Topics

Member Avatar for Jennifer84

You can make a simple function to do this using the properties of logarithms. [CODE] #include <iostream> #include <cmath> #include <string> using namespace std; void IntToString(int i, string & s) { s = ""; if (i == 0) { s = "0"; return; } if (i < 0) { s …

Member Avatar for Nowayz
0
650
Member Avatar for amroto

I am not exactly sure what you wish for the program to do, but I am guessing you want it to evaluate statements like 5 + 2 + 8, instead of only 2 operands and an operation for each evaluation. If what I am guessing you want to do is …

Member Avatar for gbantsi_2
0
132
Member Avatar for popey118

This is a game DEVELOPMENT forum, not a discuss how much you like current existing mmorpg forum. Also you revived a thread over 2 months old.

Member Avatar for hhheeellllllooo
0
82
Member Avatar for henpecked1

cout << "Enter another name or 1 to quit" << endl; cin >> i ; You are reading into an integer, so you can't expect it to be able to store a name in there. for a solution: read into a string for the name, and if the string length …

Member Avatar for henpecked1
0
289
Member Avatar for Joatmon

It has already been a few days since I signed up here, but Hi! I figured it was about time to post a thread here. Since I guess I am still new: I am a C++ learner at the moment who is wanting to go into the field of game …

Member Avatar for zandiago
0
46
Member Avatar for himanshu anand

this is the type of algorithm you should be using: determine which baloon has the maximum distance from the shooter (distance formula for each balloon then sort into an array if you will) starting with the balloons with the greatest distance from you and ending with the closest baloons. Run …

Member Avatar for himanshu anand
0
173
Member Avatar for ckins

Brackets must always appear after a function header to signal that a body exists, even if one doesn't! just add {} at the end of the function headers.

Member Avatar for VernonDozier
0
293
Member Avatar for curt1203

Well, just loop through all but the first character, and make sure it is either a digit or a period. if it is neither(even if it is a negative sign), then it is invalid input. what you already have does this [CODE] if (i == 0) { if (((myStr[i] < …

Member Avatar for curt1203
0
116
Member Avatar for Joatmon

Hi, after searching this forum adequately (I think) I have decided to post this thread asking for an easy to understand resource that describes how to do multithreading on C++ in windows. The current ones I am finding out there on the web either 1. Simply don't work or 2. …

Member Avatar for Ancient Dragon
0
111
Member Avatar for Queen of Dreams

[url]http://www.daniweb.com/forums/announcement8-2.html[/url] Please make an effort to solve the problems yourself, and if you still need help, tell us what specifically you need help with after posting some of your code segments that aren't working.

Member Avatar for mitrmkar
-1
227
Member Avatar for adnanius

simply put, cout doesn't know how to print out an interator. also I am confused as to why you are attempting to dereference the iterator when it isn't a pointer. Try converting the iterator to something you know the cout can print.

Member Avatar for adnanius
0
705
Member Avatar for amitahlawat20

My suggestion is that you return a reference to a matrix so you can do m1 + m2 + m3 etc etc. Just add a & after mat in the function header. As for your problem. this should be treated as an error whenever it called in my opinion, so …

Member Avatar for Joatmon
0
105
Member Avatar for farag

Be specific about what you need help with, that way we aren't doing your homework for you.

Member Avatar for farag
0
85
Member Avatar for guitarrick

if(input[2] != '/' || input[5] != '/') result = false; checks to make sure there are '/' in the right place, and look at the array that it is being searched through to search indexes for a digit value int numerals[8] = {0, 1, 3, 4, 6, 7, 8, 9) …

Member Avatar for Joatmon
0
161
Member Avatar for TMD

system pause seems to be frowned upon anyway, but the best replacement (if you don't care about portability) could just be to use #include <conio.h> // windows only, for getch cout << "Press any key to continue."' getch(); //waits until one key is pressed Sorry I don't know about color …

Member Avatar for Joatmon
0
78
Member Avatar for digitz101

No, not bright red, bright yellow on a slightly darker yellow background. For your scoring system problem though, I think it work if you made two parallel arrays, one containing scores, the other containing player names. Run a swap or bubble sort (the only two easily implemented sorts I think) …

Member Avatar for Joatmon
0
939
Member Avatar for guest7
Member Avatar for bornok15

return cn,ca; You can only return one value at a time, there is a way around this though, it is called passing values by reference. To pass by reference, you simply add & after the data types in the parameter list in both the function header and function prototype. This …

Member Avatar for bornok15
0
187
Member Avatar for thomascrown

if you want a simple solution, go here and check out operator<< and operator>> the basic idea is to shove into the string stream a stream you read in when asking for a value and to read into a float from the stringstream to have it formatted [url]http://www.cplusplus.com/reference/iostream/stringstream/[/url] if you …

Member Avatar for Joatmon
0
262
Member Avatar for pship07

pseudo-code for checking to make sure it is in increasing order: open file for input lastnum = read in a number while (still stuff in file) { input = read in a number if input < last num ___print input " is not in order!" lastnum = input }

Member Avatar for Joatmon
0
82
Member Avatar for Joatmon

I created a snake game using objects of snake segments that act together in a linked list type way (I think.) and I notice that when you select quit after you die with more than 2 links, the program throws some run time error. Even funkier, when I used a …

Member Avatar for Joatmon
0
122
Member Avatar for jnabeel
Re: oop

You have c1.d() and c1.bd() BOTH returning zero. Instead you should return the values you read in, return a; or return b;

Member Avatar for jnabeel
0
112
Member Avatar for nurulshidanoni
Re: pair

Well since you want to do it in a for loop, you must realize that this is probably a job for pointers since you can't make a for loop generate names for your variables to hold the class. What I would do is this: [CODE] int main() { const int …

Member Avatar for nurulshidanoni
0
266
Member Avatar for Jboy05

pseudo-code follows: .... get option while option isn't 1 or 2 display "Bad option selection, re-enter it: " get option end while if option is 1 call func1 with A and B if option is 2 call func2 with C and D

Member Avatar for mitrmkar
0
129
Member Avatar for Hockeyfreak889

There really is no "best" compiler. But when I was just beginning c++ (I actually started out with basic, then visual basic like you) I found it the easiest to compile in dev-c++. Just make sure you download the one with the mingw compiler. [url]http://www.bloodshed.net/dev/devcpp.html[/url] As soon as you download …

Member Avatar for Hockeyfreak889
0
170
Member Avatar for Joatmon

After searching around this forum for a bit, I found getch() in conio.h, this very closely matches the type of function I am looking for, but I don't want it to wait for the user to enter a key (It would be nice if it would just return -1 or …

Member Avatar for Joatmon
0
341

The End.