General C++ Programming - February 2019 (Page 9)

atomic counter and then compare value
 
Dear all, Atomic type is often used for efficient synchronized value in multi-thread programming. Here, I wrote a psuedo code. Does this code fail to ente...
[8 replies] Last: Dear Cubbi Thank you for your opinion. As possible as I can, I avoid... (by Mitsuru)
Using Template Array in another class
 
I keep getting heap errors crashing my code (mid run-time or at exit) when I use a Template Array to store user input (for (double) monthly rainfall amounts). W...
[2 replies] Last: Two problems. FIrst, don't call the arrayTemplate dtor in rainfallTrac... (by dutch)
Why is the zero-argument constructor necessary?
 
Sorry to post this long example but I am having a hard time reproducing the issue when I try to simplify it. This is a fairly tricky piece of code, thanks in ad...
[2 replies] Last: Thanks a lot. Problem solved! The clang messages were extremely helpfu... (by CABrouwers)
Reoff's
 
I am in Vex Open Robotics and we are required to have a reoff that connects to brain and to the led light strips. When we connect to autonomus we have to press ...
[2 replies] Last: Comments and indentation help (don't forget to use [cod e] tags). ... (by salem c)
Why compile under an older c++ version
 
Is there any reason to compile under an older version of C++ and not the most current stable one? For example, I code on AWS cloud9, whose default script calls ...
[1 reply] : > Is there any reason to compile under an older version of C++ and not... (by JLBorges)
What are couple of un-arguable examples of premature optimization and premature pessimisation.
 
Dear ppl, I have been seeing many guidelines to avoid premature optimizing and premature pessimization. But could not find couple of un-arguable examples of bo...
[14 replies] Last: If you always write pre-increment by default I wouldn't consider it pr... (by Peter87)
I have to find the largest number by using those function, but the largest number doesn't appear when i enter the 8 numbers
 
#include <iostream> using namespace std; double max (double array , int size); int main () { double large ,x=8, maximum; int num; cout << "Enter ei...
[1 reply] : your code, indented #include <iostream> using namespace std; double m... (by ne555)
Using 'char' to represent text
 
*** Newbie question *** 1). char day = "Thursday"; std::cout << "Today is " << day << std::endl; 2). char Day = "Thursday"; std::cout << "Today is " << Day ...
[7 replies] Last: Thanks for your help salem c (by calioranged)
C Assembly keypad Problems
 
Hey guys, I'm new here and also new to programming. I was hoping someone with more experience can tell me where I'm going wrong. The program is for an mBED ...
[6 replies] Last: Ah OK, thankyou, I will try that now (by nathan242)
by Grime
What's "Visual C++" and is it different from C++?
 
I'm really confused and I think instead of making any assumptions it would be better to get it rectified with somebody who knows the answer to this. I know Vis...
[8 replies] Last: Well, yes, that was my point. I wasn't trying to say "here, you should... (by helios)
Chef with Orchestra in the Kitchen
 
Stop spamming the board with your zero effort begging. http://www.cplusplus.com/forum/beginner/249492/
[3 replies] Last: If I had known that you can complete "challenges" for rewards when I w... (by H00G0)
by Fadey
Fastest way to input/output dynamic array of arrays into a file.
 
First example: input/output a array of std:string. Second example: input/output a class which nests other classes inside. As long as there aren't any dynamical...
[3 replies] Last: If you do your own buffering, then use open/close/read/write instead o... (by dhayden)
Does public static functions of base class become member functions of derived class if base class is inherited publicly ?
 
Hi ppl, I am trying to run the following code but getting error. #include <iostream> template <typename T> class Base { public : static T& Get() { ...
[3 replies] Last: Thanks a lot @Cubbi for the detailed explanation :) (by kapil2905)
BGL in_edges() issue
 
Hi! I started using Boost Graph Library and I've problems using in_edges() over a direct graph. I can print all out-edges for each vertex, but I'm not able to ...
[1 reply] : in_edges() is not allowed in adjacency_list<listS, vecS, directionalS>... (by EdoardoCanti)
reading from data file
 
I am having some issues with my case for the code. The purpose of this case is that, the user enters a number of hours and the if the hours worked by the employ...
[4 replies] Last: Thanks @salem c! (by hello321)
wrapping a class around a temporary (prvalue)
 
I want to define a wrapper class (BoxB) that takes another class (BoxA) as an argument by reference and stores the reference. This is not too complicated as lon...
[9 replies] Last: > The move occurs with the initialize a(that.a), correct? Technically... (by JLBorges)
resistor
 
Hi, I got a program here and it is not making the calculations,I've tried different solutions but they are not working for me, any suggestions?? #include...
[5 replies] Last: your program, in wordz: declare a bunch of floats to random values. *... (by jonnin)
templated classes and inheritance.
 
In the following code, I have a templated class, that derives from another templated class. For the code to be valid, I found that every reference to a base c...
[2 replies] Last: Excellent, thank you! I don't know if the explanation you scratched b... (by CABrouwers)
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x18 in tid 8522
 
Hello everyone! So I have this bug that's really strange to me and unsolvable. So when I debug my c++ application android it is terminated right after 'updateD...
[15 replies] Last: Cubbi. At first glance, I didn't quite understand your answer but the ... (by Putarda)
Help with pointers
 
So for this program I need to find the mode of the array. but I have to use two functions and pass the array with pointers. I understand how the pointers work i...
[2 replies] Last: void FILL_ARRAY(int *fillArray ); You're declaring an array of point... (by AbstractionAnon)
February 2019 Pages: 1... 7891011
  Archived months: [jan2019] [mar2019]

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