Beginners - October 2014 (Page 9)

2D Array Dealing Deck of Cards
 
I am trying to find a more efficient way of "dealing" the cards (lines 57 - 118). I only need to deal 2 hands, and they need to be in order (1st, 3rd, 5th ... e...
[2 replies] Last: You don't need face values or suits until you display the hands: Your... (by PCrumley48)
Prime Number or Not
 
Ok, this is my new code that I wrote and no matter what I try it always says that 45 "prime number and not a prime number". 45 is clearly not a prime number but...
[2 replies] Last: Hey thanks for the help! I was able to use your logic into my own vers... (by specter113)
by BJzero
i need help with reading from a text file
 
hi there, i have a homework to do, write c++ code for union find.. in order to do that i have to read data from a text file that is generating 600000+ of rand...
[9 replies] Last: Amount of entries is num_edges , not max . Max is the maximum possib... (by MiiNiPaa)
by hosoi
Function that adds two objects in the same class?
 
I need to write a member function in class Money that adds two Money objects together and returns the result. My instructor told me this function does not have ...
[5 replies] Last: Money& Money::operator=(const Money &rhs){ if (this != &rhs){ this... (by mobotus)
by CDavis
Structs in classes
 
So I have a problem that I have to work on which I'm having issue finding info on the internet or I'm just not putting in the right key words. Anyways I did ...
[16 replies] Last: Please ignore my last post. The OP sent me a private message with more... (by dhayden)
Some mistakes existing in the program and I dont know why
 
I know there must be some problems with the boolean expression in each if-statement. A friend tells me that it is wrong to write like this. However, it gives th...
[2 replies] Last: Less-than is a binary operator. Binary operator has two operands and... (by keskiverto)
System::Object issue
 
Hi, I did a reference to a DLL and I am trying to use a method that requires a System::Object^ as a parameter. When I create the variable and call the metho...
[6 replies] Last: Ooh sorry for that (by closed account SECMoG1T)
.
 
.kkk
[10 replies] Last: Wow, you're so great, I didn't know about that. (by S G H)
I/O - How to read data from input file and write it to ouput file and calculate the average number
 
My input file is named scores.txt with the below information: Becky Muggah 34 65 76 43 76 34 76 32 54 76 Hanna Riley 32 7 76 54 67 87 65 87 98 78 Henry Jam...
[5 replies] Last: If some people in your file have less than 10 scores, then that means ... (by closed account SECMoG1T)
Need help with strings
 
Hi, I need help with strings. I want to be able to search for a specific character, like "a". And if that character exist, I want it to get replaced by another ...
[3 replies] Last: I hope it will help you a little. Run this: #include <iostream> #inc... (by Observer)
by vxk
function parameter doubt
 
I was going through the C book Peter van der Linden and it explained that the following code is wrong ... void foo( char** argv){ printf("cool")...
[9 replies] Last: const in a different place ..?? ... means differenct things: const ... (by MiiNiPaa)
How can I make this code in 2 dimention?
 
Hi all, The code below calculates the dx/dt=u equation by euler method. This calculates the u for the position of each particles (np) and calculates the distan...
[3 replies] Last: Frankly, I have no idea what you mean by calculate the dx/dt=u equati... (by keskiverto)
by JeffP
Checking chars
 
I was assigned a program that has a single char value inputted. Is there a way to make it so that the program checks to make sure the input is a letter of the a...
[2 replies] Last: Thanks man. (by JeffP)
How to track when all the elements of a vector <bools> are false?
 
Note: I'm not using c++ 11 unfortunately so I don't have access to all_of(). I basically have a vector <bool> isHovered; As the name instantiates, when an...
[5 replies] Last: std::bitset<200> bits; // create a set of 100 bits. ... if (!bits.a... (by dhayden)
Where to begin with 3D programming?
 
So I want to make a 3d RPG game (Maybe even an MMORPG) and I don't really have any experience with 3d programming in C++. I have made games before in Java, b...
[7 replies] Last: Thanks a lot. I will look into it! (by closed account SNybRXSz)
Loops with if statement
 
Hello. I'm making a program that asks user to input a day from 1 to 31 (as max day is 31), so when user enters day that is higher than 31 the program will ask ...
[4 replies] Last: Ok, I think I understand it now. Thanks again (by CrazyCloud)
by krad23
Functions with arguments by reference
 
Is there any actual difference between these 3 function declarations? int f(int x) { return x; } int f(int &x) { return x; } int f(const int &...
[5 replies] Last: Oh, sorry for the double post, I didn't even see there was a 2nd quest... (by krad23)
Need Help continuing my program
 
I'm currently working on my assignment, but I can't get it to continue when user hit's 'r' or 'R'. Do I have to add a do while loop or is there another easier w...
[4 replies] Last: Have you drawn a flowchart yet? There seem to be three separate cases... (by closed account 48T7M4Gy)
trace tables
 
hi,i would like some help in determining what a recursive function will calculate. What i do know is that a trace table should be used,i am how ever confused as...
[2 replies] Last: b will always be > 1 (by yusufseedat)
Need Help with Looping Error for Seconds and Distance
 
Good evening! I'm struggling with getting my loop to increment properly. I know that it has to do with Seconds, but I'm stuck as to what I need to do to fix it....
[5 replies] Last: On line 28 for (Seconds = 1; Seconds <= numSeconds; Seconds++); you... (by Jezze)
October 2014 Pages: 1... 7891011... 70
  Archived months: [sep2014] [nov2014]

This is an archived page. To post a new message, go to the current page.