General C++ Programming - January 2018 (Page 9)

Rules around forward template functions to template functions
 
//g++ 5.4.0 #include <iostream> #include <algorithm> template<typename T> void func(const T& fu...
[2 replies] Last: Awesome, thanks. Makes sense; the generic lambda is still an instance,... (by elohssa)
Code in the nested do-while loop will not run on visual studio 2017 IDE (windows 8)
 
Hi everybody. Below is part of code for a continuous infrared photon laser travelling scheme. The co...
[2 replies] Last: Hi, Please don't start a new topic about the same subject, just conti... (by TheIdeasMan)
by karl05
Daisy Chains in the Field
 
The usage problem of Daisy chains in the field is extremely hard! Can anyone solve this??!! Proble...
[1 reply] : 1. Paint cow 1 green. 2. Let S1 be the set of cows currently painted g... (by helios)
c++ loop speed up
 
I wanted to test how clock function works so i made a simple program but i found something else. ...
[5 replies] Last: Thanks for explanation. I actually didnt wanted to make a program for ... (by anakata)
Adding spaces at null of char array
 
Hey everyone, I have a char array of supposing 20. like char array ; When I enter "...
[8 replies] Last: This could work. There is probably a way to condense it more, but I wa... (by Ganado)
float out of string
 
Hello everyone, How to get float out of const char* eva="I am number 1000.235 abcd" i need to ...
[9 replies] Last: std::regex num_re( "(?:^|\\s)[+-]?(?:\\d+\\.?\\d*|\\d*\\.?\\d+)(?:\\s... (by Kostantin2)
by yazhai
instantiate the value of "extern const"
 
Hello all, I have a problem with regards instantiating global constant value. I know at most of the...
[8 replies] Last: by definition, a variable is not a constant and a constant is not a va... (by jonnin)
rename class instance member function
 
Hi, i can rename std::next to n, and i want to rename list instance member function.(push_back to p...
[2 replies] Last: I think it is not practicable, we can not add new method or change met... (by Jun Zhang2)
Functor taking argument
 
I have a customer class containing Name and Age. I am wrapping the customer class in a shared pointe...
[2 replies] Last: Thanks Thomas for the help. (by shekharsahoo)
by Handge
C++ screen keeps flickering
 
I have this code but every time the screen is cleared to redraw the bar it flickers. How would I go ...
[1 reply] : Clearing the screen on every cycle is asking for flicker. Don't do tha... (by Duthomhas)
by aumars
Is it possible to execute the contents of a switch statement from the bottom-up?
 
switch (i) { case 1: printf("1"); case 2: printf("2"); case 3: printf("3"); } ...
[10 replies] Last: OP is working with an XY problem. (by Duthomhas)
Please Need Help in Assignment As soon As possible
 
Write a program that counts number of prime numbers in an Array. The program must be able to use fun...
[5 replies] Last: To judge a number n whether is prime, you should test from 2 to floor(... (by Jun Zhang2)
by iffi62
Reading an array from a text file and storing it using Classes and constructors.
 
Hello everyone. I have a an array in a file i-e 1 2 3 4 . each of these numbers are of different att...
[1 reply] : file.txt: 1 2 3 4 Put each number into the into the Foo class's me... (by Ganado)
std::accumulate inaccurate result for large container
 
Not really a c++ question, but more about floating point precision (I suspect). This gives 1.82 fo...
[5 replies] Last: Nah in my case I only ever use 1 avx instruction really - no SSE. So d... (by elohssa)
Initialising Array of objects calls constructor twice
 
The constructor for Node has a default value for the parameter it's receiving. When new is used, th...
[5 replies] Last: 2. I'm not sure what you mean. Am I not using an array of pointers no... (by doug4)
String_numput<> facet not writing to string
 
I have written a String_numput<> facet that derives from the num_put<> facet, in order to write to a...
[5 replies] Last: > In String_numput<C>, a space is not added between successive numeric... (by JLBorges)
Keylogger
 
#include <iostream> // Klavye ile deger girilebilmesi için gerekli kütüphane #include <windows....
[1 reply] : #include <iostream> // Klavye ile deger girilebilmesi için gerekli k... (by olfibits)
copy constructor for a class with an abstract member
 
Hi everyone! This question is related to how implement a copy constructor for a class that has a ...
[7 replies] Last: void copy(const MyAbstract & other) { const Implement... (by JLBorges)
expected primary-expression before ')' token
 
Hello, Here is some code which generates an error : template <typename T> struct A { template...
[5 replies] Last: Thank you very much for your answers. The solution of Jun Zhang2 is w... (by frmilstein)
sorting list
 
hello everyone, I have std::vector<string> listItems i want to remove duplicate values not chang...
[2 replies] Last: #include <iostream> #include <string> #include <vector> #include <set... (by lastchance)
January 2018 Pages: 1... 78910
  Archived months: [dec2017] [feb2018]

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