General C++ Programming - December 2015 (Page 22)

by ncaver
Battleship Code
 
#include<iostream> #include<fstream> #include<string.h> using namespace std; void Fire(/* inout*/char board); void FleetSunk(/*in*/char board ,/*inou...
[1 reply] : Well after trying to compile your program to find what errors you were... (by Shadowwolf)
5 in a row
 
I do not know how to do this I do not have any code yet but I am attempting to translate a tic-tac-toe game, below into a game like it, 5 in a row I also want...
[1 reply] : http://www.cplusplus.com/forum/beginner/1/#msg6680 (by TheIdeasMan)
by J031
Tic Tac Toe Minimax problem
 
Hello please help me with this tic tac toe program.I am trying to implement Minimax in tic tac toe and it is not working.Please correct my code.Also i need to d...
[10 replies] Last: So where in the problem? Where is the blocking code, and don't forget ... (by closed account 48T7M4Gy)
setDate and getDate issue
 
Design and Implement a class called Date that has data members to store month (as a number), day, year, and name of the month. The class should have a three-par...
[10 replies] Last: Hi again, With the code that sets the Month name: an easier thing t... (by TheIdeasMan)
Read file for code JAM compitation
 
How to read the file , to take input in single line code Example : file name : 1.txt content : 20 10 11 I want to read 20 , 10 , 11 line by line
[3 replies] Last: Then you need a loop: while(fs >> value) // Reads the data as long as ... (by coder777)
converting strings to a mixture of alternating uppercase and lowercase letters
 
Hi ya all, My prof gave me a HW to ask a user to type a sentence and convert it to a mixture of upper case and lower case each letter. So for example, a strin...
[2 replies] Last: I did as you did and it beautifully works!! big thanks!!! (by GamerOtaku)
Interrupt Shell Command
 
Hokay, so I execute commands and get the output like so: char buffer ; string command(""); while(true) { g_Client.Receive(command); if(command == "EXIT" ...
[2 replies] Last: I want to stop the process What process? See this: https://msdn.mic... (by coder777)
I have a problem in looping
 
Please use code tags <> on the toolbox on the right hand side. Also after you've done that try and help is help you and be a bit more specific about what the p...
[6 replies] Last: Cheers :) (by closed account 48T7M4Gy)
by Aideux
Linked Lists Program
 
So, I'm trying to write a program where the user inputs 5 integers, and then the program uses linked lists to sort the integers as they are added to the list. U...
[1 reply] : You have several problems: 1) You create two nodes per iteration (alt... (by coder777)
by kalki
Facing problem with getline function!!!
 
Facing problem in comparing strings #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; st...
[2 replies] Last: Hi, use the == operator http://www.cplusplus.com/reference/string/... (by TheIdeasMan)
Dungeons & Dragons based Project
 
So for my final class project I decided I want to make a very basic combat simulation based VERY loosely on 5e D&D. However I'm running into issues in my brain ...
[1 reply] : Wrote this quickly hopefully it helps you. Good night :) #include <... (by Mr Impact)
by Geeka
Error expected at the end of input../primary expression
 
Hi, I am writing a program and ive recive these two errors all of a sudden saying Error expected at the end of input and error expected primary expression at at...
[6 replies] Last: Multiple poster pest - music just stopped from me. http://www.cpluspl... (by closed account 48T7M4Gy)
by Geeka
Error expected '(' before numeric constant &'(' before ';' token
 
Am recieve an error in line 244(second to last line) stating error expected '(' before numeric constant and error expected'(' before ';' token... #include...
[3 replies] Last: Yep we've got another live one spoiling it for everybody. No more musi... (by closed account 48T7M4Gy)
Classes and Structures
 
I need help with writing this program for class. My teacher did not teach classes or structures very well and I do not know where to even begin. Here is what th...
[3 replies] Last: @ jaufdenberg69 Try writing some pseudo code - I know it sounds bori... (by TheIdeasMan)
Help Me Please!!
 
I have to write a program to find the longest "number chain" for any given max number "number chain" is computed in this way: if the number is even, the next n...
[1 reply] : Please use <> code tags around your code. Declare two variables int m... (by closed account 48T7M4Gy)
help with declarations
 
I posted something recently for one specific problem, but I realized the problem is general, and I need help with the concept. I have done research, but I just ...
[19 replies] Last: #include <iostream> #include <fstream> #include <string> using std::... (by closed account 48T7M4Gy)
Moving from console based programming into graphical 2D game development (Need advice)
 
As the title suggests I am moving into using graphics, I have set up SDL 2.0 in codeblocks and have been following lazyfoo tutorials and a few loose videos on t...
[no replies]
Dealing with arrayys !!
 
I do not know about the game battleship because I never played before, but how would I start off the code Question Using a two-dimensional array as the ba...
[6 replies] Last: How I suppose (sic) to get into (it) if I (have) never played the ga... (by closed account 48T7M4Gy)
by Yehya
Making a science fair project
 
Hello all. I am trying to make a program that will cycle through all the possible solutions until it reaches the same word as the inputted word. Here is my code...
[1 reply] : http://puu.sh/lEMeX/f9f530b39f.png Should output like this (by Yehya)
December 2015 Pages: 1... 202122
  Archived months: [nov2015] [jan2016]

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