General C++ Programming (Page 2)

Any explaining ' following a name?
 
As came across the link below, is anyone very knowledgeable on c++ syntax so explaining the char ' following identifier name (e,g below and following link is th...
[5 replies] Last: I think the OP in that HN thread had rather unusual ideas. It's pretty... (by helios)
Debugging a delete error?
 
I am pretty sure I have some sort of deletion error. How would I go about debugging it? I am still not savvy with using the call stack and finding out what it c...
[9 replies] Last: Sleep tight guys I figured it out. I also had 2 objects in main that w... (by jetm0t0)
typeid pointer recursion
 
Hello all, ive created a function named typeof that either takes any object and shows the typeid().name() result on operator<< or takes a pointer and prints th...
[8 replies] Last: Okay, cool. Thanks a lot :) Learned something new again. have a nice d... (by LukeProducts)
by t im
strcpy doesnot work
 
Just check the code below: char* s1 = "hello"; char* s2 = "world"; cout<<s2<<endl; // world strcpy(s2, s1); cout<<s2<<endl; // world Why does s2 rem...
[3 replies] Last: Get it. Thanks for your help. (by t im)
Is it possible to remake stdin (or cin) and stdout (or cout) in a library?
 
Basically, I am coding for an unusual device, with the compiler I've got, cout is working fine but cin does not work, the device doesn't even have a keyboard (a...
[7 replies] Last: If the initialization procedure might be called from multiple threads ... (by mbozzi)
how otimize code?
 
it's 'easy' create a function. but what make think is: what is the best for otimize the code? how we can win more CPU speed? how we can test the speed? the same...
[14 replies] Last: Furthermore, parallel computation requires that you have multiple thin... (by keskiverto)
LRU Cache Simulation Heap Overflow Problem
 
Hi, I'm new to C and are working on LRU Cache Simulation recently. However, when testing testcase w/ very large amount of data, it shows up that heap-buffer ove...
[6 replies] Last: And if there's anything that I can improve, maybe the coding style? A... (by kbw)
by t im
about address of std::vector<std::vector<int>>
 
Please frist read the code below: vector<vector<int>> v({ { 1 }, { 2 } }); v .push_back(3); v .push_back(4); After initialization, the size of v and ...
[5 replies] Last: Thanks for all your answers that help me figure it out! (by t im)
by t im
resize() and reserve() of std::vector
 
In most cases, resize() changes the size of a vector while reserve() changes capacity of a vector. My question is about reserve() function. First look at the co...
[7 replies] Last: Thanks for all your helpful reply. I get it. (by t im)
Tree (traversal)
 
Please help what is wrong with my codes? I created Tree.cpp. main.cpp and Node.h, Tree.h. It gives me an error. //Tree.cpp #include "Tree.h" Tree::T...
[1 reply] : At a cursory glance, Tree.h needs to declare the type Node . #ifnde... (by JLBorges)
by Cplusc
OpenMP for nested loops
 
I am writing a lattice boltzmann solver and to do so I'm using OpenMP for loop parallelization. After using OpenMp not only the execution time is not reduced bu...
[9 replies] Last: @salem c the code is easy to read. I almost used <= everywhere Expect ... (by Cplusc)
Cannot convert argument from 'variable' to 'const T &'
 
Howdy. I am using a doubly linked list to obtain requests from an input file and eventually place them into an array of queues based on priority. When reading i...
[8 replies] Last: As a starter code that compiles, consider: #include <iostream> #inc... (by seeplus)
by Cplusc
Animation
 
I'm doing a fluid simulation and for post processing I'm using paraview. For this, I need to reaload the vtk or csv file whenever i want to see the plot during ...
[1 reply] : Paraview is a completely separate application. I'm not sure that it wo... (by lastchance)
Boost Python: "Mixing a dll boost library with a static runtime is a really bad idea..."
 
I am currently trying to create a python binding for a large C++ library. After some searching, I have decided to use boost/python. I am running into a compi...
[1 reply] : Current code: #define BOOST_PYTHON_DYNAMIC_LIB #include <exception>... (by Mathhead200)
Accessing private member declared in header
 
Howdy. I have a doubly linked list class that I was given the function names for. One of them is called CopyAll which should copy all the nodes from the input d...
[2 replies] Last: Many thanks. I didn't check the provided members well enough before I ... (by malibuwiley)
Please explain what this code does
 
Hello all , All i know , This is a Buffer for thiscall Function struct sAABuffer_Helper { DWORD SecondDword; BYTE Filler ; }; struct sAABuffer { ...
[no replies]
C++20 Modules as interfaces
 
Hey guys, I'd like to use C++20 concepts to define interfaces. Usually I'd define interfaces using virtual functions but in this particular case I do not want ...
[6 replies] Last: cool thank your very much. I'm getting a better understanding of conce... (by JuliusCaesar)
how to convert message digest to bigInteger in c++
 
For example say I have a message digest "cf91cc61b74a1feda9902ae9b9e96d9a" using md5() How do I convert this message digest to a bigInteger so that I can u...
[9 replies] Last: You do not need to compile Boost Libraries to use the Boost cpp_int ... (by Duthomhas)
smart pointer issue with file
 
Hi I am facing a problem while trying to create file manager using smart pointers. Which option (unique_ptr, shared_ptr, auto_ptr, weak_ptr) is more optimal h...
[5 replies] Last: Maybe I am just slow today, but I hope you understand this, and maybe ... (by jonnin)
Error on multi-D dynamic array output
 
How solve the error on multi-D dynamic array read to be output below? #include <iostream> #include <vector> using namespace std; vector<vector<char>> l; l ....
[3 replies] Last: #include <iostream> #include <vector> using namespace std; int main(... (by lastchance)
Pages: 1234
  Archived months: [sep2022]

Cannot post in this page. To post a new message, go to the first page.