General C++ Programming - February 2017 (Page 9)

why does I get nullptr when I try access object variable
 
Hello! When I try to access a bool variable from a object in another class I get nullptr when I start my application. I dont relly know why, I have try to ma...
[9 replies] Last: Oh, sorry, I got a bit confused. In the original code expbar got a var... (by Peter87)
Ribbon Pattern??
 
So I was given a problem (helping a friend), and its says there to generate the ribbon depending on the number I input. Like this for example: if I inputted my...
[3 replies] Last: @MDLC1997: do you mean like this: For 5: * * ** ** ***** ** ** * ... (by lastchance)
PPP2 Chapter 10 Exercise 3 Help Needed
 
I'm having trouble trying to sort a vector of a certain user-defined type that I have (type Reading). I need to sort it to find the median. I tried overloadin...
[18 replies] Last: I'm not sure when to #include iomanip, though, so that could be a pro... (by jlb)
Deallocating memory in chunks rather than whole
 
In my program I will be reading in data from an external device. This data will need to be parsed. Basically, I will allocate a huge amount of memory like doz...
[3 replies] Last: As far as I am aware, if I allocate a chunk of memory and then set po... (by TheIdeasMan)
Can't display Dynamic 2D array
 
Hello, I'm unable to print my 2D array. When entering the for loop in display(), my program seems to run continuously, without an error message. Everything comp...
[3 replies] Last: This is a cleaner view: In Graph.h: private: // TODO: Complete t... (by heybronson)
by Rikasi
Input/Output devices
 
can someone explain or direct me to how input can be entered from an input device like a scanner into a program and how a program can be used to manipulate spre...
[1 reply] : You need to interface to some library functions to get from the scanne... (by jonnin)
by elsa
How to insert cout message into return statement
 
istream& ComplexNum::input(istream& in) { cout << "Enter real: "; return in >> real >> imaginary; } I have an overloaded input stream operator ">>" and I...
[2 replies] Last: Thank you helios. I was doing: cout << "Enter real: "; return in >>... (by elsa)
by elsa
Overloaded preincrement operator not working
 
I have overloaded postincrement (a++) operator in my code and I am attempting to overload the preincrement operator (++a) in my code to perform a function that ...
[4 replies] Last: That is what I feared. I had the whole concept of post/pre increment w... (by elsa)
C++ API Documentation Framework?
 
Heya Peeps, I'm building an API, and need to document it. Any recommendations? I'm looking for something: 1. Collaborative, so that contributors can cr...
[no replies]
by Bazist
Fastest associative array on C++ (Trie)
 
Hi Guyz, I have developed one of the fastest associative arrays in the world, based on Trie structures. It's quite serious implementation, more than 8000 code l...
[12 replies] Last: Guyz, I am still searching good associative containers for comparing, ... (by Bazist)
Need help on calling objects and parameter objects
 
So for say I have a function called commonType. In my main.cpp file there is a call and it looks like this: pokemon1.commonType(pokemon2) Now I am confused as ...
[2 replies] Last: Ah, I see. Thank you. It works perfectly now (by kikiyox77)
by Hengry
Copy Constructor, Copy Assignment, Move Constructor and Move assignment
 
I'm having trouble trying to implement these special members. I am reading from: http://www.cplusplus.com/doc/tutorial/classes2/#move I have a code of what I...
[11 replies] Last: Following: https://msdn.microsoft.com/en-us/library/dd293665.aspx I h... (by cire)
by Troaat
Using a constant (from within the function) in a switch statement
 
Hi everyone, So here's a problem I've encountered: I want to create an object. That object is going to contain a function, which, let's say, checks whether yo...
[2 replies] Last: Thanks, I didn't know that. (by Troaat)
Help with making output skip a line
 
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { double const adultTicket = 6.00, childTicket = 3.00; double gro...
[2 replies] Last: Ah, I see I just always assumed that when a newline character was used... (by miyahee)
Extract Resources from EXE file
 
I am making one program that it will have one executable since resources and it will extract on my disk. The code is compiled fine but ever extract or write my ...
[3 replies] Last: Error 1814 means The specified resource name cannot be found in the i... (by Thomas1965)
C++ Characters from txt
 
Hi guys! Can somebody tell me how can i do this? I have a txt file, with some sentece. All of the sentences are 40 char long. I want to make an array. For ex...
[4 replies] Last: If you really just want to get one character at a time... http://www.c... (by newbieg)
Probability analysis and implementation
 
Hey there, I realize this is mostly a math and statistics problem, and if this is a bad place to seek help, please just point me in the right direction, but sin...
[3 replies] Last: I know, in theory, how to calculate the probability of 1 win occurrin... (by lastchance)
best framework for unit Test + mocking in C++?
 
hi friends I am beginner in Unit test and mocking, and need your's help. What is best framework for unit Test + mocking in C++ ?
[4 replies] Last: You're welcome. I should have included some links: https://github.co... (by MikeyBoy)
Help me understand this logic
 
I always have trouble with logic, even when it's simple. Here is a function designed to search an array for a value, and if the value is found, the loop will te...
[1 reply] : My problem in understanding is with the bool variable and the logical... (by cire)
Singleton class
 
Can anyone explain about singleton class and when and where it should be used. Advantages and disadvantages of singleton class. then give the example program.
[1 reply] : http://letmegooglethat.com/?q=c%2B%2B+Singleton+class+pros+cons (by Yanson)
February 2017 Pages: 1... 7891011... 16
  Archived months: [jan2017] [mar2017]

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