General C++ Programming - April 2020 (Page 8)

by saing
const reference to temporary variable
 
Hi there, I'm a newb C++ programmer. I was checking out this article on const reference to temp variable https://blog.galowicz.de/2016/03/23/const_reference_to_...
[9 replies] Last: @dutch Thank you, this clears so many things for me!. One last thin... (by saing)
Question about switch case
 
Example program : int main(){ char menu; formmenu : cout << "1. 38° Fever in the past 14 days" << endl; cin >> menu; cout << endl; switch (menu) { ...
[1 reply] : Why would you use the same number on the menu to do two different thin... (by MikeyBoy)
Intro to Modules
 
Rob and Jason are joined by Daniela Engert. They first discuss a blog post on a new static analyzer feature in GCC 10 and Jason’s plans to port the classic DO...
[no replies]
general question
 
Hey everyone, First of all, I find this forum extremely helpful. It's amazing how much people help and learn things. I attend school and have a C++ class. Th...
[4 replies] Last: Some questions I can't ask because I would just have to post my code ... (by mbozzi)
Not knowing how to insert flags
 
So someone from another question I asked introduced me to this: g++ -std=c++2a -Werror -Wall -Wextra -Wpedantic -Wshadow main.cpp -o main.exe He said he u...
[11 replies] Last: Hi jonnin, So that's why 64-bits is usually better than 32-bits. Than... (by kbklpl21)
Using stack to write write the program of the sequence T(n) = T(n/2) + T(n/2) + n; T(1) = 1
 
#include <iostream> #include <stack> using namespace std; int my_sequence(int n) { stack<long> mystack; mystack.push(0); mystack.push(1); for (int i...
[5 replies] Last: I prefer recursion, but did you mean this? #include <iostream> #incl... (by lastchance)
How can I trigger my c++ by pressing on other button
 
I have the pid and the hendler how can i use it to tigger my c++. or getting the all text like pressing control+a
[2 replies] Last: This sounds somewhat like a GUI application question. Is this for Win... (by George P)
Printing an output line for results
 
Below is part of a sample code for a 3D Lidar sensor and when the code runs, it outputs a live recording of what the sensor sees in front with the shortest meas...
[3 replies] Last: closest = *min_element(data->points, data->points + data->width*data-... (by ne555)
Expected Expression Help
 
//HI, I am doing a program on Calculating Pay of Workers based on Several //Variables. However, I am getting an error on the last else line at the bottom //of m...
[1 reply] : if (flagBasePayCode && flagJobClassCode && flagYearsOfService && flag... (by Ganado)
Sort data
 
hello, i need help with this. i have to create a program that sort data as follow: if a entry pair data don,t touch the list but if a entry a impair data i have...
[10 replies] Last: <> edit tool will format code. (by jonnin)
Unless the output file is created with the correct name, its content is wrong
 
I expected the line inside the file, to have the name of the file, but instead the line contains the string that was previously assigned to the string variable ...
[2 replies] Last: Marvelous!. Solved! i've been having problems with handling string(s... (by BlakGerry)
Problem with fragmentation(Dynamic matrix Allocation)
 
Hi, i have one example with dynamic allocating 2-d arrays. The this generic function must return a pointer on pointer. Type is type of element in 2-d matrix ...
[8 replies] Last: dhayden, I also concluded that. I was running it on server that has ... (by Tinjak Mirza)
This code won't run.. There is something wrong with "to_string"
 
#include <iostream> using namespace std; class Elevator { public: // Access specifier int currentFloor; // Attribute (int variable) Current Floor number...
[4 replies] Last: Line 14: You have a typo. * instead of =. You really should have a ... (by AbstractionAnon)
Looking for ODMG Library for OO Database
 
Hi, I'm looking to develop my skills on Object Oriented Database. I am trying to find a public licence library matching the Object Data Management Group (ODM...
[3 replies] Last: There's a mac option to configure. To see them all, run ./configure ... (by kbw)
align cin and cout
 
Hello, I was wondering the easiest way to align cin and cout. For example some of my cout messages will need to be aligned left, right, and center.
[4 replies] Last: TBH, if you just want to get 99% of the code working, you can start wi... (by salem c)
help with instructions
 
Hey everyone, I apologize for asking but I have these instructions for my assignment and I'm lost. I'm supposed to create an array to print out a paragraph ...
[2 replies] Last: yeah I kind of figure it out. I have to have to getline() the sentence... (by Cjigsaw)
by colt
Practical solution to: "non-static reference member .... can't use default assignment operator|"
 
Hello, I have the following constructor: Bbox (float min_x,float min_y,float min_z,float max_x,float max_y,float max_z,vector <Triangle>& tri_ref): min_X (m...
[11 replies] Last: > In member function ‘void std::vector<_Tp, _Alloc>::_M_insert_aux >... (by ne555)
How do I sort linked list using in-order traversal?
 
I am trying to make my inOrder function work for my test file. My function is supposed to order a string of data in a binary search tree. I expected my code to ...
[10 replies] Last: That example actually helps a lot. Thank you mbozzi. (by nexteon)
why i get these errors? and how i avoid some warnings?
 
i have these code for i initializate the POINT structure: class Object3D: public SizePosition3D { public: POINT Vectors ; Object3D(Point3D Positio...
[5 replies] Last: thank you so much for correct me. i never knew about the high preceden... (by Cambalinho)
How to put data from text files in a vector?
 
So i have an assignment which basically is to create a simulator for bench files which they have in a text file the stucture of a circuit with gates. And i tho...
[9 replies] Last: Thank you!! (by melowTheG)
April 2020 Pages: 1... 678910
  Archived months: [mar2020] [may2020]

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