General C++ Programming - July 2019 (Page 3)

Call back functions
 
Hi guys, So I know/understand the basic premise behind call backs a function will take a function pointer as it's argument, and when a particular event happens...
[1 reply] : so basically how does this happen? is multi threading used?? obviousl... (by Niccolo)
How are operating systems written in C
 
Hi guys, A concept that baffles me and it may take a book to explain in detail but if you could sum it up that would be awesome, so it amazes me that operatin...
[5 replies] Last: @adam2016, The history of C is informative here. It is intimately ti... (by Niccolo)
by vpi764
Histogram
 
a program to create a histogram H of 0 ≤ N ≤ 16 entries. A histogram is a set of values and the associated frequencies of each of those values. For example...
[3 replies] Last: @Duthomhas, Firstly, presumably the OP should show some actual work. ... (by dutch)
Oregon trail - classes
 
I have been trying to make a Oregon trail game and need some help on reading/writing files to read milestone names and distances. These are the pieces of what I...
[no replies]
Getting an error while passing an array through a function
 
I have written an algorithm for 0-1 Knapsack Algorithm. I created an array based on the function inputs but I was getting an error "Expression must have a const...
[3 replies] Last: Strictly, it's a "vector of vectors", or a "sequence of rows". To all ... (by lastchance)
Static member is accessible to class object.
 
The below mentioned code looks strange to me. template <long I> struct Fibo { static const long value = Fibo<I - 1>::value + Fibo<I - 2>::value; }; te...
[3 replies] Last: I was under the impression that static members can't be accessed via ... (by MikeyBoy)
by MrSY
threads
 
hey i want to use threads to run 2 actions at the same time. so i tried the way i was able to see on sites, but after compiling my gui pops up and closing ag...
[4 replies] Last: Something along these lines, perhaps: #include <iostream> #include <... (by JLBorges)
Tile collision control with SDL2 (1,2)
 
So I am building a game with SDL and in need of some help. I've built a tilemap that's a 2D array and a draw function that draws the map with simple sprites. E....
[20 replies] Last: Ok so my bad, usually it's better to use sprites with the same size, b... (by Zaap)
Lamda
 
How do I make a lamda program print just the output? #include <iostream> int main() { (){std::cout << "hello world" << std::endl;} return 0; }
[1 reply] : #include <iostream> int main() { // anonymous lambda taking no a... (by JLBorges)
3d array
 
Here is the initialization for 3d array, i.e. n*n*5, the last dimension is 5, n could be any integer. typedef double vector5 ; double (**a) = new vector5 ...
[6 replies] Last: Thanks all. Your replies help a lot. I am used to vector as my multi-d... (by cary333)
by Odglog
How to end a thread?
 
Hi I'm working on a text based game engine, because I have to run number of things at the same time I use threads. From my little understanding of threads I kno...
[6 replies] Last: First thing first thanks for the responds. It turned out I was stupid ... (by Odglog)
need advice
 
Hi guys, so I've been programming on and off for about 3 years now or maybe a little longer, but to be honest I've never made anything I can reflect on and say...
[4 replies] Last: @Niccolo That's fascinating, you really do have a lifetime of experien... (by adam2016)
by JLP423
feet and inches to cm and meters conversion
 
Hi all, so I'm taking online C++ at my college right now, and currently I have a project of converting feet and inches to cm and meters, and we have to have 3 f...
[4 replies] Last: The return type of the function is an integer type. I used long long ... (by JLBorges)
by m1smr
CMake Find<LIB>.cmake files
 
Hello, I'm currently learning CMake and something I don't fully understand is, how CMake knows where to find the Find<LIB>.cmake files. (Windows) For exa...
[2 replies] Last: How does CMake know where to find the Find<LIB>.cmake files. CMake m... (by mbozzi)
HLSL vs GLSL matrix multiplication
 
So I am converting from DirectX to OpenGL wich means I have to learn OpenGL shading language, everything is so good for now but what I don't understand yet it w...
[3 replies] Last: It makes sense to me now thank you very much guys. by "inverted" i me... (by fewdiefie)
lost in processing .
 
Write a program in C++ that reads integer values continuously until zero or negative value is entered. Then program should displays information about each value...
[7 replies] Last: thanks guys I will try to rewrite the code . (by Reem Alnuaimi)
vectors size is exponentially big, but why?
 
Hey guys, my vector size seems to be strangely big, the revesreVev function takes in a pointer to a vector as it's arguments and sets that pointer equal to a n...
[9 replies] Last: The std::reverse() works in-place; without additional memory. You had... (by keskiverto)
inheritance and casting
 
Hey guys, I'm following a Jamie king video on youtube (https://www.youtube.com/watch?v=TFwW36dLoHY ) about inheritance and casting, I'm still not quite sure o...
[2 replies] Last: The conditional/ternary (?:) operator is more restrictive than if-else... (by Ganado)
averaging each diagonal line in a matrix
 
Hi, I have a tridiagonal matrix and I would like to compute the average of each line of nonzero entries in this matrix. I have run the code, unfortunately, ...
[2 replies] Last: #include <iostream> #include <iomanip> #include <complex> using names... (by lastchance)
Best Undergrad C++ STL Text Books?
 
Any best technical content/quality & widely used undergraduate C++ STL Programming text books used at major universities of United States for the following Comp...
[3 replies] Last: I also have Ivor Horton's "Using C++ Standard Template Library", Apres... (by AlexCantor)
July 2019 Pages: 12345
  Archived months: [jun2019] [aug2019]

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