General C++ Programming - June 2019 (Page 2)

Handling Input from boost::asio
 
Hi, I have a boost::asio server that reads into a boost::asio::streambuf with boost::asio::async_read_until that looks something like this: boost::...
[14 replies] Last: This is what I use for clipboards. void deleteControls ( std::string&... (by poteto)
std::vector create reference to element or use .at()/[]?
 
I have a std::vector that stores textures. I need to contantly render them to the screen. Would it be faster to create a reference or pointer to the texture and...
[7 replies] Last: > I was asking if I should render them like this: > SDL_RenderCopy(re... (by JLBorges)
Automatic Variables Passed to an Asynchronous Function
 
Hi, If I have a function that defines a local variable of automatic storage called newPlayer and I pass it to an asynchronous function that executes a call...
[2 replies] Last: ....which means you'll have to create it differently and store it else... (by Niccolo)
by Geomod
How to compute Gauss hypergeometric function 2F1(a,b;c;z)?
 
I am looking for C++ source code to compute Gauss hypergeometric function 2F1(a,b;c;z)? http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric2F1/...
[2 replies] Last: Note convergence restrictions: abs(x) < 1 and c not a negative intege... (by lastchance)
How to multiply and add corresponding elements in a vector
 
I have two vectors with elements [10,20,30] and [40,50,60] I need the output as 10*40 + 20*50 + 30*60 = 3200 I wrote the following code but not getting the...
[12 replies] Last: Ah, nice, there is one that does compile. It’s even uglier, though... (by Duthomhas)
delete giving core dump
 
Hi folks, Can someone help with below code giving core dump on delete statement in destructor. CODE: #include <iostream> using namespace std; class my_str{ i...
[4 replies] Last: arr{1,2} are terrible names. well, if he had worked a yohoho in there... (by jonnin)
by jmpt
Testing
 
If you can see this, please tell me. I seem to not be able to write!!!
[4 replies] Last: Test Min Distance #include<iostream> #include <stdio.h> #include <ve... (by epdlqlemqpzja1234)
by Navyan
Modern OpenGL C++ Game Programming
 
I have finished loads of C++ Courses and now I want now get into Games Development in C++ and Modern OpenGL, Are there any books for that purpose. I want to dev...
[11 replies] Last: https://www.opengl-tutorial.org/ This is where I learned the basics. ... (by zStupan)
Help Please!
 
Can someone tell me why I keep getting error messages? Please and thank you!! #include <iostream> #include <string> #include <fstream> using namespace std...
[14 replies] Last: Thanks for the assignment text. It really helps a lot. I see that you... (by dhayden)
by ag12
boolean argument in class
 
I wrote a member function: MA::MA(int ID, int num, const char first , const char last , int* arr, bool r) { BA(ID, num, first, last, arr); this->research ...
[12 replies] Last: it's working!!!!! thank's!! (by ag12)
iostream and structure in cpp
 
I must write a cpp program to read contents of the file student.txt and produce the following output as shown below. Make sure your output must be the same as t...
[8 replies] Last: This sounds an awful lot like homework. I can't imagine it being an... (by Niccolo)
by vpi764
What is error?
 
void g(auto x) { g(x - 1); }
[5 replies] Last: Well funny you should mention that, if you compile with -O3, I believe... (by Ganado)
by jpao
How to learn Vision Computing from scratch??
 
Hi there, Instead of looking through, analysing and learning the code of openCV from a top down approach, HOW ON EARTH can I learn vision computing with C++ ...
[11 replies] Last: Recently I’ve been reading and experimenting a lot with computer vis... (by simpliv)
static object of class
 
hi all.i am new in C++. what is goal to determine static object of class?what is diffrnce with usually mode? for example : #include static class* KALA; ...
[4 replies] Last: @jonnin - it should be, but.... There are situations I've encountered... (by Niccolo)
by afra
car dealer
 
Objectives: Use arrays, files, searching arrays, manipulating array contents, characters, and strings. You are asked to implement a car ordering system for Bobc...
[18 replies] Last: If done enough times could you, without difficulty, add a good few GB... (by zapshe)
Since when are negative floating points supported in C++?
 
I never needed negative floating points in my projects, and also in addition I heard somewhere lol, that negative floats and doubles are not supported by standa...
[4 replies] Last: ...and C before it. @malibor, don't sweat it though, all of us run in... (by Niccolo)
by frek
Dynamic_cast<pointer>
 
Hi all, This is our base class called, Shape : class Shape { public: virtual Point center() const = 0; // pure virtual virtual void move(Point to) = 0; virt...
[9 replies] Last: @TheIdeasMan Yes, the book is of him and I will post some screenshots... (by frek)
how to display [k]
 
i want to display , however its keep getting error at the "cout << setw(3) <<nParents << ' ';" and said that subscript requires array or pointer type i assi...
[2 replies] Last: thank you.. i got the solution for this problem (by shuthairah)
Random Array of 100 numbers ordered from lowest to highest (1,2)
 
I want to make a C++ program that can take an array of 100 random numbers, print out a 10 by 10 block of them, then print out another 10 by 10 block of those sa...
[22 replies] Last: Ran it, looks perfect, amazing (by koerd85)
Best way to avoid code duplication?
 
I need to loop through a vector in 2 different member functions. One calls the object's void update(); function, and the other calls the void render(SDL_Rend...
[5 replies] Last: Thanks for the help. A pointer-to-member-function (I used std::functi... (by itsArtem)
June 2019 Pages: 12345
  Archived months: [may2019] [jul2019]

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