General C++ Programming - May 2021

How to store cell values of date and numbers in local variables using xlnt library for C++
 
I am trying to read different cell values from a excel worksheet using the xlnt library for C++ provided at: https://github.com/tfussell/xlnt . The code that i ...
May 31, 2021 at 8:14pm
[1 reply] : does this work? int x = stoi(cell.to_str()); or double d = stod(cell... (by jonnin)
OpenMp: Parallel code takes longer to run than serial code?
 
I have a serial code with simple forward FFT function and other functions, in the main code a basic for loop for initialization purposes. This code is a much sm...
May 31, 2021 at 2:24am
[8 replies] Last: nah that 1 thread run isnt random. its likely it cached something afte... (by jonnin)
sdl program not restarting
 
i have literally spent all night trying to ask the user to if he wants to play again pres enter, and when he does press enter, the game restarts but i guess som...
May 30, 2021 at 10:40pm
[1 reply] : debug it, step through what all your variables are in the second run. ... (by jonnin)
Is there a means of redefining free functions?
 
I'm writing some unit tests for some extension methods, and some of the other extension methods call each other. The only problem is my fake extension methods o...
May 30, 2021 at 4:56pm
[1 reply] : yes, you seek preprocessor, look up an example of #ifdef -- it forms a... (by jonnin)
Failure of boost::geometry::within for polygons
 
Dear experts As this title, I failed boost::geometry::within, some are succeeded but the others are failed. I wonder if boost::geometry::within has specif...
May 30, 2021 at 11:25am
[2 replies] Last: @Mitsuru, when you say "failed", what do you mean? Can you give examp... (by lastchance)
Dynamic programming. Recursion. Loops.
 
Hello! Please tell me how to implement an algorithm with recursion using loops. "main.cpp" #include<iostream> #include "methods.h" int N, M, *a, **mas_r...
May 28, 2021 at 8:42pm
[13 replies] Last: Oh, thanks a lot!) (by hentaimean)
by dkaip
Remove duplicates of vector problem
 
Hello. I have the classic remove duplicates of vector. At line remove_duplicates(channels); compiler say channel has no member url. struct channel { ...
May 28, 2021 at 4:15pm
[4 replies] Last: Thank you. Finally code. std::vector<channel> channels; te... (by dkaip)
by Laiter
Connectionless p2p library
 
I'm looking for a simple library that allows me to send packets between pc's using their IP and without establishing a connection between them. Also it would...
May 28, 2021 at 10:32am
[2 replies] Last: In that same vein try "socket programming C++" searches if you haven't... (by againtry)
In C++20, <chrono> has been extended by the Howard Hinant date library but some things are missing
 
Hi, Although it is nice that <chrono> has been extended, there are some functions that I haven't found after looking intensely... For example conversion f...
May 28, 2021 at 9:34am
[3 replies] Last: C++ version support for the major compilers is at https://en.cpprefere... (by seeplus)
Is there/What is the C++ version of the strlen function?
 
Hello there, I was working on my game engine's string class when I ran into an error while trying to compile on Linux (I normally compile with MSVC). The compil...
May 28, 2021 at 12:36am
[2 replies] Last: some decades ago, c++ stuffed all the standard stuff into namespaces a... (by jonnin)
Vector of objects
 
Hey ya'll I'm new to vectors and I have created a class of PaintJobContracts, which should have fields for a customer's name, job number, and amount owed. I wen...
May 27, 2021 at 11:03am
[4 replies] Last: Hello coff33Cup, keskiverto has a very good answer. I take a more ... (by Handy Andy)
VS2019 16.10 constexpr
 
VS2019 16.10 is supposed to include support for the C++20 constexpr for std::string and std::vector. So why doesn't this work? What have I overlooked?? #incl...
May 26, 2021 at 4:39pm
[5 replies] Last: OK. So for compile time definition, you can use constexpr with std:arr... (by seeplus)
FFTW plans using OpenMP
 
I have the following function using the FFTW3 plan and I am trying to parallelize it with openMP. I am following with the FFTW doucmentation, however I don't th...
May 26, 2021 at 11:39am
[3 replies] Last: This declaration has no storage class or type specifier at line 8 h... (by againtry)
Programming and data structure
 
Implement an unbounded double-ended Queue (using the single or double-linked list) as a template structure (aimed at storing values of any type), and the...
May 25, 2021 at 7:53pm
[1 reply] : I did not have time to read your code closely. However, based on a qu... (by doug4)
by mist3
Storing multi-character character in an array
 
Hello, I'm having trouble storing non-english letters (ą, č, ū) in a char array. It does store them in a normal char array, but takes up two spaces (ex. char...
May 25, 2021 at 12:17pm
[2 replies] Last: instead of std::string s; say std::u16string s; char16_t instead o... (by jonnin)
Implementation of Sorting Algorithms
 
You should write a program to sort an array. For this purpose you will implement two sorting algorithms: Insertion Sort and Merge Sort. For each algorithm, you ...
May 24, 2021 at 8:19pm
[10 replies] Last: ^^ this is more important than it seems at first. When I started, I ... (by jonnin)
by RicoJ
Why do I have to assign a {} expression to an object?
 
I'm playing around the bracket list expression, and I got an error error: expected ‘;’ before ‘}’ token when running this: int main() { {1,2,3...
May 24, 2021 at 5:30pm
[3 replies] Last: And in case you're specifically after a legalese type of answer, the s... (by Ganado)
by axl
Extract certain integers from string and add them.
 
Hello, so I'm a little stuck with trying to solve this problem out. The task I face is to read through the string numbers and decide what the greatest sum is ...
May 24, 2021 at 5:25pm
[3 replies] Last: #include <iostream> #include <string> int bigSum(const std::string&... (by seeplus)
SDL music and event que doesnt sync properly
 
currently i am creating a main menu for a game in which I want a background music played and a different one when the game actual starts, the game starts by pr...
May 24, 2021 at 3:58pm
[3 replies] Last: Please don't update code in previous posts. Now @salem c's response m... (by doug4)
Simulating Nodes on a network.
 
Hi guys, So this is probably a basic networking question, I want to write a script that will simulate nodes on a network. I could set up a number of virtual ma...
May 24, 2021 at 12:45pm
[2 replies] Last: Thanks salem :) Never thought about the above points (by adam2016)
May 2021 Pages: 123... 5
  Archived months: [apr2021] [jun2021]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.