General C++ Programming - May 2015 (Page 8)

Newbie needs help! Game code for Map Game stuck...loop will not loop as intended
 
Can't get this to work...roadblock....help?!? I am new to this and am trying to write game code for a C++ course at Delco CC. Any help would be appreciated grea...
[1 reply] : if(space == 1||4) // this is incorrect if(space == 1 || space == 4) ... (by Texan40)
Encrypt/Decrypt string
 
/* i need to encrypt and decrypt a string, using the following syntax. I need help with the encrypt/decrypt functions. I have to use the ASCII chart and i'm un...
[1 reply] : I can't really tell how you want to encrypt the characters? You have ... (by Texan40)
c++ program for stick game
 
user vs computer:On each turn a player can pick up between 1 to 3 sticks. Who has to pick the last one loses.The computer first plays randomly(it should be trul...
[2 replies] Last: You could just start by writing a program and don't factor in the pr... (by mutexe)
little explanation needed
 
Can someone, please, explain what these lines of code do? string slurp(fstream& in) { std::string content((std::istreambuf_iterator<char>(in)), (std:...
[3 replies] Last: Thank you guys. Really appreciate it. (by itsallpoison)
how to add node in between in a linked list
 
Hi, i am new in linked list, and now i face a problem on how to add the node into middle of a list. Example like if i got a name list show below: 1.andrew 2.er...
[8 replies] Last: @cshingk I am assuming you are showing a list of First names, not L... (by koothkeeper)
How to create a pointer to a vector/array in a class member function?
 
Say I have a text file with gibberish formatted as lines of strings. djfhaklsjdfhaskljd sdhfksjhdfjhskdjfh sdfjhskfjhskjdhfks fhhiwobhgrjkrbfjrd ... etc I hav...
[3 replies] Last: then you could return a vector of vectors back I guess? Or encapsulate... (by mutexe)
Function to convert given number of seconds to day,time year since 1/1/2008
 
Hi there, Given number a number in seconds like 82166400, i want to get a function that can convert it to time since 1/1/2008 (Hr, mins, secs, month, day, ye...
[1 reply] : First you need to write a function to calculate if a given year is lea... (by mutexe)
Outputting route from SF-NYC
 
Hey Everyone, I needed some help with my program. The purpose of the program is to create two routes from SF-NYC from selected "legs". I have a collection of...
[10 replies] Last: That worked! You are amazing, thanks a lot! (by lordhalomaster)
Coding a Simple Game
 
So I have to code a simple game. 1. The "random numbers" (couch, pocket and bed) are all the same. 2. I keep getting this "else without previous if" error me...
[3 replies] Last: Ye lol you put the data type "int" in your first if statement. Delete ... (by Momothegreat)
Recursion on Linear Linked Lists
 
Can anyone help me on these two recursion problems? I'm just practicing recursion on my own and I'm having trouble figuring out the solutions to these problems....
[3 replies] Last: Thank you so much, cire! I've been mulling over this problem for a few... (by chmstry)
please help with small practice program
 
the program is supposed to get numbers from the user into a dynamically allocated array, next it is support to use 2 other functions to sort and average said ar...
[1 reply] : I tried running the code and the sort() function is an infinite loop. ... (by Twk Amz)
Vector attribute of a class containing vector attributes
 
Hi, I've got a problem with a class Player that should have a vector of Monster as an attribute. The real problem is that the class Monster has already a vector...
[2 replies] Last: Thanks for the hints ne555! But I've found the errors and resolved! I ... (by valerio92)
by Debn
Maze game help
 
Hello! I'm making a maze game but I can't understand how to generate new levels. Please help Code: http://pastebin.com/2PQ34XNE
[3 replies] Last: Welcome :) (by Codermik)
by Ceset
Interprocess Communication Through Pipes
 
Hi everyone The child process is a chess engine(stockfish), which you communicate using console normally. I am trying to communicate with it through pipes. Bu...
[5 replies] Last: Temaran adviced to try some other methods. But just out of curiosity ... (by Ceset)
Why 'cin' takes more characters when not used in loop
 
In the following code if I am typing more than 20 elements then all of them are displyed instead of displaying first 20 elements as the varibale 'ch' is declare...
[2 replies] Last: Well, strictly speaking it's more the case that you should not read in... (by andywestken)
Align a matrix with decimals and negative numbers.
 
Hi, I hope you can help me. I need a piece of program that with a given 2 dimensional matrix, it aligns it, so that it is shown justified in the console. I alr...
[6 replies] Last: Don't bother. I've just figured out how to do it. It turns out, I just... (by Osej Alhasad)
Anyone can help me to sort this code alphabetically ?
 
Anyone can help to sort this code alphabetically ?
[2 replies] Last: you could use a STL-container like std::vector to store the names and ... (by Gamer2015)
Why my compiler skip a cin???
 
MY compiler skip a cin. I am using cin.ignore(); and double cin to stop this. Sometimes works, sometimes not.
[1 reply] : To answer this question, we really need: 1. to see the relevant code ... (by andywestken)
Clarification on random numbers
 
Hello, I have this random number generator unsigned long int next = 1; /* rand: return pseudo-random integer on 0...32767 */ int rand(void) ...
[13 replies] Last: Haha never heard of FreeBSD ... I can`t read fully the source, but th... (by pacman169)
by Alimoj
Problem with static varibale and default constructor defnied in polymorphic class
 
Dear All users; I am new to C++ programming. I would be appreciative if you help me with solving my problem. I have a problem with adding some lines to tut...
[5 replies] Last: While, Thank you for your reply. (by Alimoj)
May 2015 Pages: 1... 678910... 22
  Archived months: [apr2015] [jun2015]

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