General C++ Programming - February 2018

Help filling new dynamic array of type pointer
 
Help I am making a program to add sparse matrices from two files into an output file. My problem is ...
[3 replies] Last: Note that you try to print size1 elements from m1. There are no size1 ... (by keskiverto)
Why do we need heap ?
 
why do we need heap if we can simply do this: Player *player; void createplayer() { Playe...
[7 replies] Last: but in visual studio when i try to go address of newplayer object it ... (by doug4)
Composition
 
Hi, may I know if there is a way to B object without calling A object beforehand? class A{ priv...
[2 replies] Last: Duplicate of: http://www.cplusplus.com/forum/beginner/232211/ Please... (by MikeyBoy)
Is *(new Object()) a bad practice?
 
In Java and other languages it is much easier to create a new object for a function, such as: doSo...
[5 replies] Last: Thank you all for the answers! (by daverave1212)
C++ Queue Code: Keeps spamming output until it crashes
 
#include <iostream> #define MAX_SIZE 100 using namespace std; int main() { int item, choice; ...
[7 replies] Last: Oops... yes, you're right. Thanks! Although my point still stands. ... (by MikeyBoy)
Identifying values between tags [Help Needed]
 
hey all, recently, I have been trying to construct my home-brewed way of identifying values between ...
[7 replies] Last: Thanks everyone for the help, but I ended up deciding to simply use JS... (by DrewRiddles)
C++ - Calling a virtual function in another class
 
Hello, I'm trying to call a virtual function declared in another class. I understand that the no...
[9 replies] Last: which is declared as a non virtual function. Actually, assuming Do... (by doug4)
While Loop Word Search
 
Hello, I am needing to write a word search program that will take the user's input and let them k...
[4 replies] Last: > may i ask why you choose to use std :: im very new to C++ so im tryi... (by JLBorges)
Can I create variables during compiling time in in c++
 
I appreciate it if someone has the answer. Can I create variables during compiling time in in c...
[2 replies] Last: If you already have defined and initialized the array of 729 elements ... (by Peter87)
Hello Admin/Moderators! There is someone spamming here!
 
Hello Moderators/Admins: Good day. Upon checking the threads here in General C++ Programming, the...
[1 reply] : I am trying to report the spamming activities, but it still kept on cr... (by kindgnice)
HELP
 
Instead of copying the assignment from your school, give some examples of things you have tried. We ...
[1 reply] : @DrewRiddles is extremely right! P.S. Bro, I noticed some spamming a... (by kindgnice)
Is *ptr++ = tolower(*ptr); well defined?
 
A guy in the office thinks that the subject code is well defined. I'm pretty sure that it's undefine...
[16 replies] Last: > The question is whether the post-increment of the pointer is guarant... (by JLBorges)
Possible While Loop Problem
 
I am trying to practice doing random c++ programs and in one I came across the problem where my prog...
[1 reply] : Once inside your while loop, onesDigit never changes. tensDigit nev... (by Repeater)
how can I printed the result with 10 numbers per row and with 5-character width for each number?
 
#include<iostream> #include<iomanip> int counter = 0; for (int n = 2; n <= 200; n++) { //(1) ...
[1 reply] : adding if ((counter % 10) == 0) { cout << endl; } afte... (by fcantoro)
Matrix class using vector
 
Hi, I want create a matrix class using the STL conteiners vector, but I have some problem when I wan...
[2 replies] Last: Your code with code tags: #include<iostream> #include<vector> using n... (by fcantoro)
./....
 
....
[3 replies] Last: @DrewRiddles is right. This is the purpose of a forum. If you are dele... (by kindgnice)
by Tduck
How do you find missing brackets/braces?
 
I've been searching for hours in my code, and I simply can not find where the missing closing bracke...
[10 replies] Last: Yes, get a decent editor and use the editor’s ‘ find-matching-brac... (by Duthomhas)
Need help with move constructor/assignment operations
 
I am completely lost in move constructor/assignment functionality. I am writing Pointer class for A...
[4 replies] Last: Thanks a lot for this explanation. (by afedorov)
[Solved]
 
Hello! I am currently having quite the problem while developing my software. I cannot seem to find a...
[4 replies] Last: std::quoted is a C++14 feature. What compiler do you use? (by Thomas1965)
by Mk87
random generator binary numbers
 
according to this random generator number code: srand(time(0)); for (i = 1; i <= 26; i++) { bu...
[2 replies] Last: vector <bool> is sometimes optimized to store single bits on many impl... (by jonnin)
February 2018 Pages: 123... 11
  Archived months: [jan2018] [mar2018]

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