General C++ Programming (Page 10)

class BoxOfProduce c++
Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegetables to you...
[3 replies] Last: Line 15: How many strings do you think you're allocating? Why is Box... (by AbstractionAnon)
Write two overloaded functions that return the average of an array with the following headers: int ...
[3 replies] Last: roughly, for a vector average: for (auto n : a) avg+= n; avg/=a.size(... (by jonnin)
How can I pass value through a specialized template class?
Here is my problem I have an existing no-template class A, currently being used by many places. I w...
[11 replies] Last: Thank you very much, JLBorges. (by chrisben)
Help with some structures/for loops
I am working on a program to make a small library of the ten books I have chosen. With this program ...
[2 replies] Last: string name; cin >> name; That is formatted input that skips prefix ... (by keskiverto)
by Halken
Roman Numbers
I have written the following code, however, I am having issues passing part 1. #include <string> ...
[1 reply] : > I've been asked to complete the following class questions. And now ... (by salem c)
Help with converting tolower string
Im a beginner c++ programer and I'm trying to use an array but cannot figure out how to get it to wo...
[1 reply] : This is a “prove you have been paying attention in class and reading... (by Duthomhas)
by stav
Templated NonCopyable Singleton class ?
Hi i have the following code: template <typename T> class Singleton { public: static T& GetI...
[3 replies] Last: [quote=stav] i get an error on line 7 I apologize for adding a post i... (by Enoizat)
by Deamer
I have python code, I want to chang it to C++. How to di it?
img = cv2.imread(image_path) h, w, _ = img.shape mser = cv2.MSER_create(_min_area=100,...
[4 replies] Last: boxes = boxes[boxes[:, 2] > 10] boxes = boxes[boxes[:, 3] > 10] boxe... (by ne555)
FailCheck a Char.
So I'm trying to write a fail check for a char data type so that in case a user inputs a word then i...
[4 replies] Last: all 3 ideas behave slightly differently. I was going off the idea tha... (by jonnin)
by plexus
Using strings in switch statement
Hi, I recently had this idea of how to use strings directly in a switch statement without too muc...
[8 replies] Last: To solve your specific problem, take the easy way: an if..else if sequ... (by Duthomhas)
Going blank after input
Currently my program will close after I input my racer's names and time.I was wondering if anyone co...
[4 replies] Last: or, in beginner speak, conditions are explicit. the compiler does no... (by jonnin)
virtual function
Hi, I am learning Virtual function in c++. I read Virtual function is member function that is used ...
[2 replies] Last: how run time polymorphism(i.e;one name multiple forms) is achieved th... (by keskiverto)
not sure where the error is
#include <stdio.h> #include <iostream> #include <string> #include <sstream> #include <fstream> using...
[4 replies] Last: Does this version give you the same errors? #include <fstream> #incl... (by Enoizat)
Generic function pointer type
I am developing a class that needs to store a call back function. So it needs to include a pointer t...
[2 replies] Last: class Thing { std::function<void()> callback; public: void setCallb... (by Peter87)
Creating a class book
Hi, everyone I am working on this question. Booker University maintains an inventory of books. The ...
[2 replies] Last: Line 4 should not have a ; Line 8: author and title only hold a sing... (by AbstractionAnon)
Absatrct class destructors : why ?
If I understand well an abstract class needs to have an explicitly defined destructor, correct? At ...
[1 reply] : If I understand well an abstract class needs to have an explicitly de... (by Peter87)
How to edit original object through object* temp that points to original object?
So if I have an Object called Friend with a member called name. I do Friend* f1; Friend* te...
[4 replies] Last: here is a sample code: if you scroll all the way ... (by Enoizat)
by ajiten
srand48() : Unable to compile due to scope issues on Windows in Dev-C++.
Dev-C++ version 5.5.2 (Windows 7) gives compilation error that occurs in the last line in main(): ...
[18 replies] Last: Very sorry, but had bad experience in getting no response earlier. So,... (by ajiten)
Accessing template parameter pack
Suppose I have this function: template<typename...T> void doSomething() { } and I call it...
[3 replies] Last: "doSomething()" is just a method in which I want to access the Ts th... (by mbozzi)
by bfhad
C++ inheritance and UML files// I keep an error saying no matching function for call Passenger:Passenger
//Person.h #include "Person.h" #include <iostream> #include <string> using namespace std; Per...
[1 reply] : if you don't understand the error message, then post it verbatim || f... (by ne555)
Pages: 1... 89101112... 17
  Archived months: [feb2019]

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