General C++ Programming - May 2022 (Page 2)

Making A Presentable Table?
 
Hello, I have a program below that it supposed to output data for storms analyzed in a data file. However, the table looks a bit odd and is kind of difficul...
[4 replies] Last: What compiler are you using? If VS2022 you can use C++20 std::format ... (by thmm)
Constructors help
 
Hello, I'm learning on how to use Constructors and I can't figure out what's the problem in the code below Can someone lend me a hand in fixing the code below...
[3 replies] Last: 1.You forget to include the head file---<string>, include it. 2.You fo... (by ningfan666)
by jonnin
Trying to add lazy constraints to traveling salesman problem
 
if (ui - uj + lokasyon * xij <= lokasyon - 1) { any chance this logic came from a system that uses as first index of arrays?
[2 replies] Last: Hmmmm, someone got booted, here's what was "said": [quote=oxanaxu]for... (by George P)
cplex fails to solve when lazycuts are added
 
i am trying to add the subtour elimination constraints as lazy cuts Huh, what? For starters: Please learn to use code tags, they make reading and comme...
[1 reply] : Duplicate: http://www.cplusplus.com/forum/general/283651/ (by George P)
Locale Specific Code
 
I have some code that is supposed to manually separate the numerical groupings for arithmetic types when grabbing the locale being used; I'm in the midst of wri...
[3 replies] Last: BTW, India is the only outlier in digit groupings that exists in the r... (by Duthomhas)
Passing in an array of structs to a function
 
Hi, I'm looking to pass an array of structs to a function and wanted to check that the way I'm doing it and using internally within the function is good pract...
[8 replies] Last: > If, however, in the OP param comes from passing a pointer from say ... (by JLBorges)
Using TinyMAT library in c++
 
Hello everyone. I am programming in c++ and I am using the TinyMAT library to export what I have written in c++ to matlab. I need to write a .mat file with ...
[1 reply] : https://github.com/jkriege2/TinyMAT -> Does the example shown on their... (by newbieg)
Input a name and convert it to an encrypted name
 
using string as a data type, how to make a program where you input a name and then coverts the letters a to @, e to ^, i to !, o to * and u to $ regardless if i...
[8 replies] Last: #include <string> #include <iostream> #include <cstring> std::strin... (by seeplus)
Can you create an instance of a class using a variable?
 
I am trying to make a class that is created based on user input. I was wondering if it is possible, and how to, create an instance named with a variable that wi...
[4 replies] Last: https://stackoverflow.com/questions/72245348/using-user-set-variables-... (by lastchance)
by Cplusc
CUDA
 
I am working with VS 2022 and CUDA 11.7. I am trying to run the following example named VectorAdd.cu and I just keep getting the same error in any different exa...
[2 replies] Last: Thanks. (by Cplusc)
by lcs123
Problem in calling a .hh file.
 
For this question, i have basically 4 main files, let's call it: Constant.hh Constant.cc (where a define the function) Field.hh ...
[4 replies] Last: I have not worked with Cmake, specifically. But I do have some experi... (by doug4)
is it possible insert a string to the beginning of a stringstream?
 
has the title states, i am wondering if it is possible to insert a string at the front of a stringstream buffer?
[4 replies] Last: > insert a string at the front of a stringstream buffer? We can use t... (by JLBorges)
by Pen72
BFS maze
 
Hello, I've been trapped by this problem for days. Now passed three cases, but still got three terminated due to time out and three wrong answers. I really want...
[3 replies] Last: @zapshe - that's the problem and why I haven't tried. The actual input... (by seeplus)
Outputting the number of values in a txt file?
 
Hello, For my project I am meant to put out a small table regarding wind speeds, categories, etc, of Hurricanes. I am having trouble adding the number of sto...
[2 replies] Last: As a first refactor, possibly something like (output needs formatting!... (by seeplus)
Thread much slower than the function itself?
 
Hi everyone! I've made a function that runs fast but when i use a single "thread" to perform it the application slow down from 650fps to 50/100fps!! Unfortuna...
[13 replies] Last: As already mentioned creating threads should be done only once at the ... (by coder777)
by SSDEEZ
function to update height of a node
 
I'm trying to create a function that can return a node at a given key after inserting into a binary search tree, I've done that part, but I want to update the h...
[5 replies] Last: this all seems to be working with simple testing... could use cleanup.... (by markyrocks)
by Cplusc
shared memory
 
I have been working with MPI for a while and I've got some questions regarding what is really happening behind the scene. I know in shared memory architecture a...
[11 replies] Last: @keskiverto In case of GPGPU, The device's memory of different machine... (by Cplusc)
Period of the reciprocals of prime numbers
 
The period of the reciprocal of a prime number is the number of decimal places in 1/p until it begins to repeat. E.g., 1/7 = 0.142857142857..., so the period is...
[10 replies] Last: 1,666,665 repeating digits in .02 seconds is no mean feat. (by againtry)
Multi-threaded event queues?
 
Context: In some games I'd imagine commands can be entered faster than they complete. For instance, a player might enter a movement command, and while the playe...
[5 replies] Last: If'n you plan on using nothing not available in the C++ standard libra... (by George P)
Multidimensional array data storage
 
I want to store an 80x80 array where each array will have 3 integer values. Nay Idea on how to get this done? I've been trying to no success
[3 replies] Last: Another potential solution may be to use an STL vector coupled with a ... (by ziad ismaili)
May 2022 Pages: 123
  Archived months: [apr2022] [jun2022]

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