General C++ Programming - September 2018 (Page 3)

by colt
Massive memory leaks leads to "corrupted double-linked list:"
 
Hello, I recently added some code that creates a dynamically allocated, bi-dimensional array, fills ...
[3 replies] Last: Why plain arrays at all? The std::vector would manage its memory with... (by colt)
Public or Private in this case?
 
Let's suppose I have created a GUI calculator, I have these variables Private one; Private two; ...
[9 replies] Last: Well, thanks for your explanation. (by omer123)
by Gagavn
How to input and output without Cin and Cout - pleas help me !!
 
Hi guy i am new nember and nice to meet verry body in forum I have a question: How to Input and Ou...
[6 replies] Last: For output, write busy loops with varying iterations along with sleeps... (by Ganado)
by mbozzi
How do I use string_view where a C-string is expected?
 
I've written a function foo() whose purpose is to call something that requires a C-string: void ...
[6 replies] Last: Just wanted to post an update: I've been using something like the c_... (by mbozzi)
Event System Implementation Issues
 
Hey everybody, lately I've been working with game engines, trying to understand how they work, start...
[1 reply] : According to the documentation I found on line, you made a small mista... (by doug4)
I/O files, functions,error checking
 
Hi guys, I have to write a program that does the following: Write a program that reads data from...
[2 replies] Last: All I have right now is what I posted. I only have the main.cpp file s... (by explicit)
how to declare and initialize variables off main.cpp for use on main.cpp
 
I have 30+ variables grouped together in my main.cpp that I would like to move the declaration and i...
[10 replies] Last: Thank you, I have a lot to study. It might be that the answer is to ke... (by technologist)
by deanF
Help Printing templated AVL tree
 
i have no idea as to how i would write a print function for this program and i was hoping somebody c...
[1 reply] : You need to visit every node and output it. Recursion can be applied. ... (by Repeater)
by d1456
one-dimensional array
 
Create a one-dimensional array to read 20 alphabetical letters (your program should be able to detec...
[8 replies] Last: if (isalpha(letter )==0); is wrong. it should be if (isalpha(lette... (by Repeater)
Error in ./a.out: free() issue
 
Hey, I'm getting an error when deleting a dynamic array in the deconstructor of an object. This is ...
[1 reply] : movie m(name,classification,critic_rating); movies =&m; } // <-- m ... (by Peter87)
trace driven memory simulator
 
a trace driven memory simulator and run a set of experiments using simulator Simulator should acc...
[5 replies] Last: I assume this is some kind of school assignment. If you have no idea w... (by helios)
Inheritance going wrong
 
I'm working on a simple game framework based on SDL2. I have two base class types; - item (which ...
[2 replies] Last: Ah, thank you Thomas1965. I had the wrong idea about how virtual fun... (by newbieg)
How to change the function such that it guarantees a linear time worst case runtime.
 
struct Node { T data; Node *next; }; Node *front; Node *back; The be...
[3 replies] Last: See http://www.cplusplus.com/reference/list/list/erase/ and consider r... (by homy18)
C++ | I/O
 
Write the program in c++ that the names of the files to read are passed to the program as command li...
[1 reply] : rather than getline, you might want to just read word by word... stri... (by jonnin)
by rcx11
Pointer to Member Function (I know; I'm not supposed to)
 
I'm trying to set up an equations solver using the GSL root finder routines. In short, I have variou...
[6 replies] Last: Well, if you are calling a static member function, you no longer need... (by doug4)
How to remove the 'k' number of elements in a linked list.
 
How to remove the 'k' number of elements in a linked list. I search the many sites on the internet ...
[7 replies] Last: Sorry, I missed that. in the case of splitting a list, you do want to ... (by jonnin)
Help with threads
 
Hello everyone! Here is the code of the Universal Turing Machine from a few text files which can exe...
[2 replies] Last: > I need to figure out a way how can I make this Turing Machine parall... (by JLBorges)
Help Needed in these Calculations
 
#include <iostream> #include <cmath> #include <string> using namespace std; int numberOfPeople...
[3 replies] Last: you assign numberOfBatches before you read in numberOfPeople. you c... (by jonnin)
by cmisip
How to access a derived pointer member from base?
 
#include <iostream> #include <string> #include <memory> #include <stdio.h> #include <string.h> ...
[10 replies] Last: Thanks Guys, These are really good answers. I might be trying to solv... (by cmisip)
"while" problem
 
hello , i have a some problem , if i write yes or no programme working succesfull but if i dont writ...
[5 replies] Last: Right, I was more referring to the act of returning than the value. 0 ... (by uplime)
September 2018 Pages: 12345... 9
  Archived months: [aug2018] [oct2018]

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