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

deductible parameter type still requires explicit reference cast, e.g., std::thread
 
The following piece of code (which is supposed to crash) is compilable using MSVC but not in g++ #include <iostream> #include <unordered_map> #include <thread...
[2 replies] Last: > Although MSVC compiles successfully but it does not run correctly, b... (by JLBorges)
Recurrsion
 
My teacher gave me the following code and told me to give the output, the conclusion I came with is that it will print the contents of array "copystring0" which...
[2 replies] Last: At the risk of sounding facetious alex067 this is what you get for out... (by closed account 48T7M4Gy)
Linked List Unhandled Exception
 
I'm making a simple linked list class, but when I display the current values, it will display the values but then the compiler will abruptly break and the unhan...
[8 replies] Last: What happens if the user enters 'Q'? It will print "Invalid" and then... (by JayhawkZombie)
by mnm71
How can store size of vector first then do Condition??
 
I cast int value in vector then for vector.size() condition ,do something my condition is if(values.size()==1) in first time always vector.size() is 1,how can w...
[4 replies] Last: tnx,what can use instead of while() in your code??because I have while... (by mnm71)
Double Linked List, move?
 
I'm just curious if it's possible to move to a specific node directly, without traversing through the list. For example, lets say the user wants me to move t...
[3 replies] Last: It's O(n). Using a for-loop or while loop shouldn't make a difference... (by JayhawkZombie)
by m8r
Coffee shop
 
A coffee shop would like to have a new cashier system. This coffee shop serves only three (3) types of drink: Latte, Cappuccino, and Mocha. This program requi...
[1 reply] : This is what I have so far. Please tell me what I did wrong and what... (by closed account 48T7M4Gy)
Accessing a Void difficulty
 
Hello! I'm having trouble accessing a void that has variables inside of it. I would like to keep it similar to the other Voids (playOneHand()), but any advice w...
[6 replies] Last: Don't get hung up on access to the array. Think of it this way, if yo... (by dhayden)
and this is my code How can I write code for words from the file are read into an array of strings, one word per string.?
 
Hello I try to write the code but it only displays the first line for example my txt file has 100 line and one word per line word1 word2 word3 and th...
[2 replies] Last: thanks ^^ :) (by selflearner)
Help with doubly linked list deletion/insertion
 
Would someone please help me with this problem. I have tried different concepts but I don't think that I am doing it correctly. I understand linked lists well b...
[1 reply] : A couple things here: 1) use a different image uploading site, one th... (by JayhawkZombie)
passing int array to std::thread
 
I'm having some difficulty passing an array of integers to a threaded function. void process(int array_holder , int second_parameter); int holder ; int additi...
[6 replies] Last: The error message you provide does not match the code you've given. E... (by cire)
error initializer before int
 
I'm currently working on a final project for a class. It is a five card stud game and the error that is: final project.cpp:59:1: error: expected initialize...
[5 replies] Last: Its like the function is not being recognized. Yes. It is like the ... (by cire)
parent pointer will not be set in A*
 
I atempting to set the parent pointer of node, and then push that node into a vector.. But every time I push into that vector the pointer to the parent becomes ...
[3 replies] Last: I am trying to limit myself here, instead posting a wall of codes.. ... (by cire)
Need to make a Four In A Row program, values in 2D array won't change...
 
So, I've gotten an assignment in class to make a Four In A Row game, but it won't work properly; The values of the board won't change, and as far as I can see i...
[1 reply] : It's very important to format your code nicely so that it can be read ... (by JayhawkZombie)
How to sum rows and sections in 3d array.
 
Hi guys, I am new to programming and I am new to the site as well. This is my very first post and I am finishing my very first semester in college. I am havi...
[4 replies] Last: thank you for catching that. It was supposed to be 'l'. I have fixed i... (by RayDALL)
Genetic Algorithms
 
Hi can someone please help me to find a reusable code for a project which I am working upon. Problem: I want to implement an genetic algorithm which will be u...
[no replies]
i cant read my text file.......
 
i can read my first customer detail,others cant...How me solve please,i'm still new... void main() { system("color 8a"); SYSTEMTIME t; int choice, txnCode; ...
[3 replies] Last: I haven't tested it, but IIRC calls succeeding the first to fscanf wil... (by cire)
Hotel Bill Program
 
having trouble with this program was able to compile and fully do it just not correctly bc I hard coded the numbers and didnt use the variables correctly and co...
[1 reply] : You have comments from your teacher already. I don't understand what ... (by kbw)
by Borneq
How clear all object in contructor?
 
class A has many fields: class A{ int a0; int a1; int a2; int a3; A(); } contructor A can clear field by field: A:A() { a0 = 0; a1 =...
[5 replies] Last: If you have an array of 4 elements it's very easy to initialize all of... (by Peter87)
Replacement for sprintf
 
Hello, I am changing my way of writing code from pure C to C++. For format functions like printf, the replacement is cout. But what are the replacements for ...
[3 replies] Last: See: http://www.drdobbs.com/sutters-mill-the-string-formatters-of-ma/... (by JLBorges)
enum in a subclass ...
 
Hi friends, i want to ask if somebody know a way to arrange next circumstance : Inside a base class we have a enum : class Base { public: enum Enum { obj...
[9 replies] Last: May be, previously not work because i use Qt, and it use a intermiddle... (by danjiun)
December 2015 Pages: 1... 1415161718... 22
  Archived months: [nov2015] [jan2016]

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