General C++ Programming - October 2015 (Page 13)

by yj1214
Assigning value and compare at the same time?
 
int y = 1; int x = y == functionThatReturnsOneOrTwo(); What does above code do? How do I use 'x' in if and while statement? if(x){ } while(x){ } ...
[2 replies] Last: y = 1 -> y is true y == functionThsat...() -> functionThat...() is tru... (by Ericool)
Why my tic tac toe program not working
 
#include <iostream> #include <cstdlib> #include <stdalign.h> #include <string> #define orif || using namespace std; int main() { int z, turn, x; bool...
[2 replies] Last: in c/c++ element of array starts at 0. So if you said you array is of ... (by Ericool)
Do constructors need to take arguments?
 
1. I found the example below online and I had a question about the constructor. What if it was just simply Date() and it took no arguments? Or what if it was si...
[2 replies] Last: When calling this you wont need to enter any parameters because these... (by Ericool)
Challenge for everyone!
 
I have this finals lab exam wherein it became a take home exam for no freshmen understand and get the codes. We need to make a program that print out the highes...
[4 replies] Last: Oh Sorry! (by jhnryntln)
Why doesn't this compilation end?
 
Hi, I am sharing this code below. The question is, it counts what I want correctly end stops counting. However, afterwards it can not end the recursive function...
[4 replies] Last: @cire thank you so much! That was a silly mistake. (by istemihan)
Queues
 
can someone tell me the reasons for declaring inc () as a private method in circular queues.
[6 replies] Last: Okay think i got it ! (by char123)
Null Cypher
 
I want decode a cipher like AAAMAAAeAAAeAAAtAAA AAAMAAAeAAA AAAIAAAnAAA AAASAAAaAAAiAAAnAAAtAAA AAALAAAoAAAuAAAiAAAsAAA ...and try only printing every fourth...
[8 replies] Last: how about now? Well, it looks like the dereferencing breakthrough is... (by closed account 48T7M4Gy)
by BK0523
Need Help Please
 
Hi, could anyone help me with this please? I am trying to add to my current program that asks the user to input multiple values. one per line and then...
[5 replies] Last: Hi, Just be careful with equality operators with float s or double ... (by TheIdeasMan)
by vinny1
My Program will not compile
 
I have been assigned to create a program for a mini casino where the user start with twenty dollars and can bet on multiple games such as Flip the coin, Guess t...
[6 replies] Last: std::vector<std::string> suits { "C", "D", "H", "S" }; Which compil... (by TheIdeasMan)
by vinny1
M
 
This was a mistake
[no replies]
Remove if, all but one instance
 
Is it possible implement a "remove_if" statement so that it can delete duplicates in a map, but leave one instance of the element? If I have a multimap of names...
[4 replies] Last: Many different ways... // http://ideone.com/Ir7I8e #include <algori... (by cire)
by Bwoods
CHESSBOARD PROGRAM HELP
 
My code thus far prints out an entire chessboard w/ pieces. Each piece has been given their own algorithm on how they can move, and I move them during compiling...
[2 replies] Last: Okay I fixed that. Now do you think you'd be able to assist me. And mi... (by Bwoods)
I'm really confused with the program
 
The professor already has given us the main.cpp file all I need to do is write the implementation file, but I really don't know how to write it. I have some cod...
[4 replies] Last: http://www.learncpp.com/cpp-tutorial/811-static-member-variables/ (by closed account 48T7M4Gy)
Using Visual Studio as an IDE without making a solution?
 
I have been following a long Handmade Hero's tutorial series and I have been using vs 2015 enterprise. I want to know if it is possible for me to continue editi...
[1 reply] : A project has to have a parent solution file, but you can just make in... (by LB)
Scott Meyers' quote.
 
Hello all , I was watching a talk by one of the famous people in C++ world by Scott Meyers, the author of Effective C++. He mentioned something about the purpo...
[2 replies] Last: https://www.youtube.com/watch?v=ltCgzYcpFUI This is the link of the t... (by Aziz as)
"Delete[]" creates an infinite loop
 
int main() { int * major = new int ; major = 9; major = 12; major = 15; for (int i = 0; i < 3; i++) { cout << major << endl; } ...
[1 reply] : You have several places with undefined behavior: 1) You are creating ... (by MiiNiPaa)
add to enum items
 
enum Ship { SHIP_BATTLESHIP, SHIP_AIRCRAFT_CARRIER, SHIP_CARGO_SHIP, SHIP_DESTROYER, SHIP_BARGE, SHIP_TUGBOAT, }; How do I add SHIP_TITANIC to the li...
[11 replies] Last: You can't change that at runtime. Thank you now it makes sense to m... (by technologist)
Accessing database from client using C++
 
say I want to access a record in DB and another person in other place wants to do the same, how can I apply using C++ concurrent access ? Just can tell me th...
[1 reply] : The database manages concurrent access for you. Look up "transactions"... (by LB)
by ay2306
directory for exe file.
 
Hello guys.. I want to create a program which runs another program and save .exe file of in-called program other than its own .exe file. Like a setup software....
[3 replies] Last: @hdj: Please read http://www.cplusplus.com/articles/j3wTURfi/ (by LB)
SDL with Visual Studio Community 2015
 
I have been trying to set up SDL2 to work with VS Community 2015 for the last two days. I have been trying to execute this basic code: #include "SDL.h" in...
[5 replies] Last: [quote=lordnikon428]The only reason I am doing this is because trying ... (by LB)
October 2015 Pages: 1... 1112131415... 27
  Archived months: [sep2015] [nov2015]

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