General C++ Programming - March 2021 (Page 2)

by sm9
How to know where an identifier was defined before (1,2)
 
I am trying to compile a program which consists of multiple c and fortran source files. There is one C source which refuses to compile, because an identifier wa...
[22 replies] Last: @helios Thanks! I am not a programmer, I am a chemist, so these things... (by sm9)
C++ math logic
 
How to do a simple math logic as examples below? Use the following - is the largest - is the smallest - is between Example 1: A: 46 B: 58 C:1...
[1 reply] : One approach: * have collection of (label,value) pairs * sort the coll... (by keskiverto)
Wrong coopilation
 
I'm new to using c++ and I have to design and code a C++ program that utilizes a function to calculate the following for each employee from the time record inp...
[4 replies] Last: Woooow, that's what OP meant by "duplicate". I didn't realize the x pa... (by Ganado)
C++ call stack Problem
 
(This is the Question) Implement the following function: int max(int a, int b, int c); Your program receives 3 numbers and prints out the maximum number. (and...
[3 replies] Last: #include <iostream> #include <algorithm> #include <initializer_list> ... (by lastchance)
by c1885
random double Please help me understand this code:
 
I am working on understanding the following code: Question 1 To begin with I do not understand what this line does: uint64_t timeSeed = chrono::high_res...
[5 replies] Last: You do know about C++ classes and templates? I am just leaning ... (by c1885)
Template for irrationals without approxiimation
 
As the title suggests I am looking for a template that handles arithmetic with irrationals without converting them into doubles I have a rough idea of what's...
[2 replies] Last: Search this forum for "rational" and "fraction." There are dozens of e... (by dhayden)
How to make different comments different colors in Visual Studio Code?
 
I'm trying to define what my code is doing as I go along so I don't get confused when I come back to it later - but my project has comments describing what each...
[2 replies] Last: you can change xml comment to another color and use /// for those. b... (by jonnin)
SPF Calculator for Sunblock
 
Hi guys! I am working on a program that calculates sunblock data. One function is to calculate the SPF, given the UV index and the melanin level of an individua...
[1 reply] : Wikipedia says you don't have the data in the right units to calculate... (by helios)
confusion to understand Dynamic memory in C++
 
C++ dynamic memory says, we will allocate memory what we need right? so in sense it's create one run time, like we can get input form user the size we need and ...
[3 replies] Last: This above program give error in MS visual Studio, but work in other ... (by keskiverto)
OOP C++(constant char pointer) (1,2)
 
I have some problems with the const char error. Its comeout a segfault for the result, please help me with this. *authors input is more than one class Book...
[29 replies] Last: I can see that all the other compilers can run the code. I dont know w... (by qtngmin)
by JRManx
Linked List adding node issue (1,2)
 
I've been working on a little project that requires linked lists, and it's been a long time since I did them...and things have gotten a bit rusty. So, I wrot...
[24 replies] Last: But either way you still have to traverse through the list nodes to g... (by dhayden)
by frek
std::cin's APIs
 
Hi all, I'm developing the project below. How is it from your point of view? #include <iostream> #include <vector> bool binary_search(std::vector<int> vi, i...
[12 replies] Last: The frek:: is the "simple rename". (by keskiverto)
by frek
The TEA Algorithm input/output text
 
Here's the TEA algorithm I'm working on: #include <iostream> #include <string> #include <fstream> #include <iomanip> #include <exception> void encipher( ...
[5 replies] Last: How to write each byte individually and cast each byte to a char to be... (by frek)
Void Programming Question
 
void printStars(int);/*( ADD:) the function prototype for printStars */ int main() { int numofstars; cout << "Enter the number of stars in the first ...
[3 replies] Last: Wow thanks ! (by Sunnycoder)
Not sure how to proceed here with min stops for gas
 
For line 34's function, stops, I tried to see if I needed to call functions for minimum gas or find the last index but I couldn't seem to obtain anything from ...
[no replies]
How do I avoid a nonstatic reference error
 
The following code: class X { public: const X& x; class Y { void func() { x.run(); } }; // class Y void run() {}; X() : x(*this) {} }; // ...
[5 replies] Last: @Ganado Ahem (also, "Aho") you're right. What I eventually did is to ... (by lostbits)
Pseudo threads
 
Hello! Please tell me how to emulate the work of multi-threaded mode in one thread. Are they suitable for this Coroutine? OR https://en.cppreference.com/w/cpp/t...
[2 replies] Last: For Windows, you could use fibres. You can have multiple fibres within... (by seeplus)
system Error
 
Hello , how can hidden this msg " The program can't start because xxxx.dll is missing from your computer" ? i know the dll file does not exist but I do no...
[1 reply] : I don't think it's possible to avoid this message when the dell is loa... (by coder777)
What is a regular expression to parse csv files?
 
MSVS 16.9.2 I am using regex to parse input lines in a Comma Separated Value (csv) file and can't seem to get a correct RE. Using ECMAScript (https://docs.mi...
[6 replies] Last: It turns out that my csv output is dead simple. It contains only a ':'... (by lostbits)
how compare simples aspes?
 
how can i compare simples aspes? string text= "safdsA var ifl ; -.67Ç 68.9\"hello \"\" mother!!!\" \'d\' afdsafd , if do"; for( CharacterIndex=0;CharacterIn...
[6 replies] Last: from these text: string text= "safdsA var ifl ; -.67Ç 68.9\"hello ... (by Cambalinho)
March 2021 Pages: 1234... 7
  Archived months: [feb2021] [apr2021]

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