General C++ Programming (Page 2)

by vgdd
What is wrong with this code
for (int i=0; i<= phrase.size(); ++i) { cout <<"Character at position"is": <<phrase << endl; }
[2 replies] Last: The size of the container is not a valid index so you need to use < in... (by Peter87)
How to define a virtual class member function in .cpp file that is declared in .h file
Hi, I am trying to put all class declarations in .h file and all definitions in .cpp files. But I ...
[2 replies] Last: Thanks @Golden Lizard :) (by kapil2905)
by vgdd
Adding player 2 to Nim
Hey! This is my code so far and it works fine but Player 2 cannot win only Player 1. Anyone know how...
[1 reply] : Without giving any code because I'm at work, your code needs to store ... (by rcast)
Help with c++ calendar
I need some help with setting up an output file for my full year calendar and displaying the start d...
[4 replies] Last: @oatmeal678 I tried different things with your dayofweek function, an... (by whitenite1)
Problem with error message creating an instance of a struct
This is the error I am getting on the "return *node1" Error: no suitable conversion function from "B...
[1 reply] : You're returning a BinaryTreeNode object by value from the function. D... (by gunnerfunner)
by helios
Simplifying template code
I have the following function: template <bool V> struct conditional_assignment{}; template <> str...
[3 replies] Last: Maybe conditional: (by coder777)
by masol
how to embed opencv library inside visual c++ 2010 using lib
Hi. i want to embed opencv library inside visual c++ 2010 using lib. i do this work but my exe file ...
[1 reply] : Did you read this (by coder777)
Level of Nested for loop in c+
I have written a c program with 256 nested for loop. But, I have heard that it is not possible to r...
[2 replies] Last: > I have written a c program with 256 nested for loop. This is fundam... (by JLBorges)
How to fix this in Linear Search?
This is my program code for my linear search program. The condition of my professor was to generate ...
[7 replies] Last: Yes, thanks Peter87 , you are right. (by Chervil)
the code terminates before i even initialize the inputs
#include<map> #include<iostream> #include<vector> int N=0; struct Node{ int index; ...
[6 replies] Last: Netbeans is a piece of junk , im downloading VS2015 <3 Thank you Ne55... (by zeroblank)
Deleting items from map while iterating problem
So in my code: //triggerEvent is called in engine update every frame. void EventManager::trigger...
[6 replies] Last: This works perfectly! Thank you very much helios :)! (by Putarda)
Need help with Portable program missing dll
Hello every one. I am using visual Studio 2017 RC to write a portable calculator (run in Ms-dos env...
[3 replies] Last: You have to use the XP toolset if you want to run on XP. There's no ot... (by helios)
Unable to display two objects through a class of link list with a union method
I am having trouble displaying my method for link list. I either display obj1 or obj2 but I can't fi...
[no replies]
Pointer won't point at beginning address in array
This code is designed to count the words in a string, but that's not my concern right now. It's not ...
[1 reply] : Lines 32 increments string3. After each increment, string3 refers to... (by dhayden)
How to declare and define class member functions separately using template.
Hi, I am trying to write a template class, in which member functions are declared with class definit...
[2 replies] Last: Thanks @ne555 for pointing that out :) Wat a silly mistake :( (by kapil2905)
Unable to exit program properly
Hello I am wondering how I could have the user enter "exit" in the update read and have it end. I th...
[2 replies] Last: #include<iomanip> #include<iostream> #include<string> #include<algori... (by JLBorges)
Error message leaves me hanging
I am taking a long shot here, but I wonder if the error msg I am getting when trying to compile my p...
[1 reply] : Is this message specific to something or is it some generic statement... (by cire)
stack and queue commenting
I am having difficulty in adding well explained comments to this code. does anyone have any help ple...
[2 replies] Last: IMO, a lot of your code doesn't really need comments. If one chooses m... (by TheIdeasMan)
Code compiling in Visual Studio but not g++
I have the following program that seems to compile and run fine in Visual Studio, but I can't compil...
[6 replies] Last: Also consider updating your compiler. g++4.9 is pretty old now. g++6.3... (by TheIdeasMan)
Trouble Bubble Sort of book titles
I need to make s c++ code of sorting of book titles. 1. display the Inputted book titles. 2. display...
[8 replies] Last: Strike-throughs show code I deleted. Underlines show code I added or m... (by dhayden)
Pages: 1234... 28
  Archived months: [dec2016]

Cannot post in this page. To post a new message, go to the first page.