General C++ Programming (Page 12)

by volang
Pointers within the same range/memory block
In some cases, after incrementing pointers I want to make sure that the pointer is still within its...
[7 replies] Last: you should always know how big a pointer is. If you allocated it, you... (by jonnin)
by volang
Char pointers assign
Hello, hope you all are doing well! How do I make "a" ("a" is inside another function) equal to "...
[7 replies] Last: I tried std::string for images/videos, which didnt work String is de... (by dhayden)
by aster
avoid use of malloc/free on a function
Hello, A few month ago i made a function (thanks to the help of the forum) that take a char string ...
[5 replies] Last: Since you don't manually allocate memory, yes. However just being mem... (by jlb)
by aster
function works if called once, memory leak if i call it again
EDIT: my bad the problem was not inside the function Hello, a few months ago i wrote here for ...
[5 replies] Last: Well, ok, I feel embarrassed for this. This line in ArrOfArrs::double... (by Enoizat)
by H00G0
Error trying to pass function as argument
Hello! I'm having a problem passing a function as an argument, to another function. Consider the f...
[10 replies] Last: You can't have it both ways. If the function interacts with a (non-st... (by H00G0)
I am trying to create a following code with the information below.
How would this be written with the following information: Create a Person class. This class has th...
[3 replies] Last: #include <iostream> #include <string.h> using namespace std; class ... (by shanno8)
Kaprekar constant
Hi, I am trying to make a program, which calculates how much steps are necessary to get to the Kapre...
[3 replies] Last: FIrstly, learn to use code tags to post code! You probably just need ... (by dutch)
by ruzip
Deleting and Freeing an Array of Structs/Objects from Memory
How do I free and delete an array of structs/objects from memory? I tried free and delete , but t...
[16 replies] Last: Yes, I got it now that is why I decided to just to delete and reset th... (by ruzip)
by Ganado
Edit your post and add [co de] and [/ code] around your code and output to format it. https:/...
[3 replies] Last: I'm glad he/she got the answer they wanted. It's over to the teacher ... (by againtry)
Output problem
Hi, I have the following code: #include <iostream> using namespace std; int main() { in...
[5 replies] Last: Ok, thanks lastchance (by yabi2943993)
Output problem
I have a program which takes an input for a case, then makes the output and if the input is 0 it sto...
[5 replies] Last: Thanks to all for your help. For those who asked, why I want to do suc... (by yabi2943993)
Factory can't access friend's constructor
I have a factory: class FordFactory : public ICarFactory { public: FordFactory() { } ~Fo...
[8 replies] Last: > It's make_unique that seems to have trouble accessing the protected ... (by JLBorges)
Top 10 bugs found by the static analyzer in C++ projects in 2019
Do you want to look into the darkest spots of open source projects and see what kind of bugs are wai...
[no replies]
Saving multidimensional vector to hdf5 format.
Hello Forum, Since multidimensional vectors in C++ (vector<vector<vector<etc...>>>) are not nece...
[1 reply] : Never done that, but since HDF5 has C++ interface and documentation, I... (by keskiverto)
SFINAE problem
Hello, I'm trying to use SFINAE to detect when a class has a member function but I have found a pro...
[3 replies] Last: template <typename C> static constexpr std::true_type test (d... (by mbozzi)
Exception Thrown
Im trying to sort an array without using sort built-in function and i dont know why im getting this ...
[7 replies] Last: @doug4 i apologize to you i really do but i couldn't handle the situat... (by abdallahosama)
How would I Re-write the following binary search function so that it uses recursion
int binary_search(int arr , int find, int low, int high) { int middle; while(low <= high) { ...
[5 replies] Last: #include <iostream> int binsearch( int A , int value, int low, int h... (by lastchance)
Exception Thrown
Im trying to sort an array without using sort built-in function and i dont know why im getting this ...
[2 replies] Last: I don't see the unresolved external. You don't need <algorithm> in yo... (by doug4)
by lo2
How to detect stack overflow?
Hi there, Recently I tried running my C++ program with a much larger data set, and I quickly got ...
[7 replies] Last: if it helps the vector version of double cov ; is vector<double> cov(... (by jonnin)
by mnnsa
is this a dynamic programming problem
is this a dynamic programming problem can you give some tips to solve this ..... You are given an a...
[5 replies] Last: thanks, got it (by mnnsa)
Pages: 1... 1011121314
  Archived months: [dec2019]

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