General C++ Programming - January 2016 (Page 3)

variadic constructor?
 
Hi, I have a variadic template factory function that accepts an unknown number of arguments. This is supposed to call a private constructor, but I don't know...
[3 replies] Last: if you omit the forward, you might be copying where you could have mov... (by Cubbi)
by pnoid
Assertion failed error with opencv
 
I'm trying to select a region of an image with opencv but I randomly get this assertion failed error: OpenCV Error: Assertion failed (y == 0 || (data && dims ...
[2 replies] Last: Thanks so much. I can't believe I missed that. (by pnoid)
Convert temperature between celsius and fahrenheit
 
I am supposed to write a program that allows the user to convert a temperature either from celsius to fahrenheit or fahrenheit to celsius and use separate funct...
[2 replies] Last: You have several issues with your code: 1. You are calling functions... (by closed account E0p9LyTq)
Testing a bad allocation?
 
I want to test some of the exception handling in my program, but it's hard to do. I will almost never have a bad allocation. Is there a way to debug in the spe...
[3 replies] Last: [quote=keanedawg]I want to test some of the exception handling in my p... (by closed account E0p9LyTq)
making a lambda template...
 
Hi, I wanted to create a template lambda so that I do not have to re-define this behaviour for each possible type.. like so: ///// want to avoid this: ...
[4 replies] Last: Ok, yes I know I can use a function object... but, I wanted to see how... (by JUAN DENT)
distance between two atoms
 
Dear all, I am newbie in programming language, especially in C++. My problem is the following: i would like to read an external .txt file which contains th...
[10 replies] Last: in case I will paste here the piece of code Please, use code tags. S... (by keskiverto)
From structure to array
 
Hi. i have this code and I want to put all the information input into an array and find the highest salary input. How could I do it? Thanks. struct person ...
[4 replies] Last: Okay thanks! I even found the min value of the salary! Thanks a lot! (by michellee)
linked list
 
linked list need copy constructor?
[2 replies] Last: Bjarne Stroustrup: Why you should avoid Linked Lists https://www.yout... (by Thomas1965)
Program that turns decimal base to any base from 2-16 gives reverse number
 
Hello! I am trying to make a program that turns any number with decimal base in number with any base from 2-16, but the program I have written gives me the numb...
[2 replies] Last: Another option would itoa. http://www.cplusplus.com/reference/cstdlib/... (by Thomas1965)
by bambam
Finding Mode with no Arrays!
 
Hi guys, noob programmer here, so anyway, my professor gave us an assignment this week and i'm just stumped on it - i'm sure it's a really simple solution, cuz ...
[4 replies] Last: If possible, please post the exact text of the assignment. I suspect ... (by dhayden)
by Kubani
a strange pointer error
 
Hi, Would you please have a look at this simple code (its name is test1 )? I don't know why my VS 2015 compiler gives an error :( #include <iostream> using ...
[3 replies] Last: cpp.sh runs it successfully! This code has no successful behaviour,... (by Moschops)
by a10e29
raw pointer to unique_ptr
 
Hello, Is it possible to convert a raw pointer to a unique_ptr? If so how would I do that? Thanks in advance
[1 reply] : Hi, Not sure about converting, but a unique_ptr can own a pointer... (by TheIdeasMan)
Psuedorandom Code generator
 
javascript:tx('Having some difficulties with a program. The purpose of the program is to generate psuedorandom numbers. The first set of numbers is random. T...
[2 replies] Last: - Why not use constructor initialiser lists? http://en.cppreference.co... (by integralfx)
Volume of cone using structures and pointers
 
Im writing a program about calculating the volume of a cone using pointers and structures. Here are the directions: ----------------------------------------...
[2 replies] Last: - Your input prototype doesn't match your implementation. //void i... (by integralfx)
Using C++ for experiment
 
Hi, I need to get this code to ask for the initial speed, omega. I understand it would need a prinf statement followed by scanf, but do not know what to include...
[11 replies] Last: Hi, according to our lecturer we have to have it starting with the #in... (by lillybug)
using merge from the algorithm library
 
Could use some help trying to implement these two vectors using merge I get an error on line 28...i got back_inserter from some sight i was researching -A...
[5 replies] Last: If you can't be bothered to post the actual error messages (preferably... (by cire)
by Kubani
Creating graphical apps in C++
 
Hi all, If we want to create Android and iOS apps and also be able to create Windows apps as well as apps for cross-platform systems like various devices and...
[8 replies] Last: Sorry I don't have any detailed info on Qt and I don't know these. Do... (by Thomas1965)
expected primary-expression before ')' token
 
im a beginner programmer in c++ and i am haveing this problem and dont know what to do.(last line) http://puu.sh/mKElD/b58a377d02.png the code: #inclu...
[7 replies] Last: Then add the missing braces after line 78. I can't do it for you. (by coder777)
Merge sort
 
I want to do a half merge sort, that will start from the elements of the vector What i want to do: ->Organize the elements from lower to highest How will I d...
[1 reply] : Please use code tags when posting code. Highlight the code and press ... (by dhayden)
by Quark
An implementation issue: Polymorphic types and separate compilation (1,2)
 
Hi there, I have a problem that is not related to how C++ is seen from the ISO standard point of view (external) but this is an implementation issue (internal)...
[36 replies] Last: There is no interoperability between binaries compiled by different ... (by helios)
January 2016 Pages: 12345... 18
  Archived months: [dec2015] [feb2016]

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