General C++ Programming - September 2021 (Page 4)

Help with a C++ Project
Hi! I am pretty behind in my c++ class and trying to finish a lab. The instuctions are below. I'm not looking for a whole coded answer because I want to learn i...
[3 replies] Last: Thank you! You helped me and I figured it out :) (by cbriggs25)
How to get variable to linux command from config file?
Hi everyone. I have a code script that deleting unused logs. I have this function for it. +5 represents the days. I want to get it from outside, from a config ...
[4 replies] Last: To avoid security problems, use "/bin/find" instead of just "find". T... (by dhayden)
by VoB
How to fix the leak in this simple Single-Linked List?
Hi everyone, I have the following simple implementation of a Single-Linked List #include <iostream> #include <vector> #include <cassert> #include <algorithm...
[7 replies] Last: Ah yes, that for loop is really the classical way to traverse a contai... (by VoB)
Linked Lists Help
I am relatively new to C++ programming and this is an extra problem assigned to me that I do not understand but want to do it so I can learn more about it. Basi...
[5 replies] Last: You're writing c code for using memory. void add(struct Node** ref... (by seeplus)
c++ buffer overrun warning error C6386
Hi all The program below executes OK but getting one warning C6386 as shown below: "warning C6386: Buffer overrun while writing to 'df.m_Dats': the writable s...
[6 replies] Last: Still a rubbish attempt at for ( uint32_t f=0;f<N... (by salem c)
by Cplusc
Vector size
I have a function like below, in line 49 the size of p is 6. but when I go inside while loop, when calling MPI_MxV function, p becomes zero and I don't know why...
[4 replies] Last: Yes, you are right. Thanks (by Cplusc)
Turning into a template
I have been working on this question for ages and i keep geetting it to the point with no issues, but then it wont complie due to unresolved externals(The worst...
[1 reply] : #include <iostream> template <class T> struct cpair { T a, b... (by mbozzi)
by Denvor
How to implement type Auto?
Hi, I'm supposed to make a class called Auto with the make model type, etc. I am supposed to have a data member named nextAuto with type auto. This however is g...
[7 replies] Last: class Auto{ //your current code without the `nextAuto' line }; class... (by ne555)
C++ with Embedded Boards
Hi, I am an embedded programmer and I was wondering is it possible to program embedded microcontrollers using C or C++. STM32 works on C language but other b...
[7 replies] Last: Do you want to program in C or C++? Your title says C++, the body of ... (by George P)
by VoB
Why is this snippet leaking memory even if I use unique_ptr?
Hi everyone, consider the following snippet: #include <iostream> #include <memory> int main(){ std::unique_ptr<int> p_to_int{new int{10}}; auto tes...
[5 replies] Last: Thanks for that info, I wasn't aware of this! (by VoB)
Accessing function from constructing class
This may be a stupid question so bare with me. Let's say i have a class called "A" that constructs a class called "B". Can class B access functions or variables...
[4 replies] Last: In the snippet you provided, you're fine if you define class B first i... (by AbstractionAnon)
Linked List problem in displaying the result
I encountered a problem every time I try to run this code random numbers will always appear #include<iostream> using namespace std; struct dataType{ s...
[5 replies] Last: #include<iostream> using namespace std; struct DataNode { stri... (by againtry)
Help with processes questions
Please help this uses C in conjunction with C++ I am not familiar with how to go about these prompts: " Use the ps, ps -lx, pstree and ps -aux commands to d...
[2 replies] Last: This has nothing to do with C or C++. It is all about observing the pr... (by Duthomhas)
by gadi01
Incremented optimization variables depending on data
Hi, I have a problem of minimizing a function to optimize variables which 2 of them are depending on number of data point. for example, and for each data point,...
[13 replies] Last: What I have to add I need your help please (by gadi01)
Does data race of non atomic variable lead to delay?
Dear experts As expressed in the title, does delay happen when data race of non atomic variable (normal variable) exists? My code perhaps entails such a delay,...
[8 replies] Last: I am sorry for my late reply. > helios I appreciate that your theor... (by Mitsuru)
by ChiX
Frequency Distributions
How can I write a program to read a file and out the individual characters in a horizontal bar according to the appearance of each character on the file?
[2 replies] Last: Thank you Ganado (6032), I really appreciate your time and assistance.... (by ChiX)
Help me about homework (1,2)
Write a program that reads a whole number of up to NINE digits and prints it in words. For example, the input 13247 ought to produce thirteen thousand two hundr...
[20 replies] Last: Yes, thank you everyone. (by sonnguyen0604)
Nest Classes
I am just wondering, when or why would I choose to use nested classes and why not just use composition. I know I am missing something ... Thank You ki...
[1 reply] : Look at the first answer to this stackoverflow question: https://stack... (by George P)
Not able to get current cursor position
I'm using ncurses.h to make a simple GUI to my C++ project. I'm just trying to get cursor position when the user click with mouse but I always get the same outp...
[2 replies] Last: (by salem c)
How can i correctly make the definition of class in cpp
Hello , I am really new in c++ development . I created a class Backend . In Backend.h I defined a constructor . So I...
[1 reply] : Show your code. (by TheIdeasMan)
September 2021 Pages: 123456
  Archived months: [aug2021] [oct2021]

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