General C++ Programming - April 2020 (Page 4)

by Nnnb19
Transition between two different values
 
I need to make a transition between two different values and get all the numbers in between. For example: 2 transitioning to 4 in 5 seconds -- (2, 2.5, 3, 3.5 ...
[4 replies] Last: ... (by salem c)
Removing items containing references from a std::vector
 
I have a vector that holds references to animations, something like: class SwapAnimation { Sprite &first; Sprite &second; public: SwapAnim...
[2 replies] Last: thanks, I've switched to forward_list, as it fits perfectly in my exis... (by tofiffe)
Is the math.h library written in binary or c language?
 
Can anyone tell me if the implementation of functions of cmath library is in binary or C?
[4 replies] Last: @ TheToaster C++ is a proper superset of C. I see no reason why C-rel... (by Duthomhas)
need help writing to outfile
 
hello every one i am writing a code for a class and i have it almost completely written i just need to have the output written to a txtfile and i'm not sure how...
[4 replies] Last: Writing to cout is actually the right thing to do. If your program i... (by dhayden)
by bsmith
Struct Destructor
 
I am having trouble figuring out how to setup a destructor for a struct. Here are the items within the Node struct: char title ; double leng...
[3 replies] Last: To be clear about what Ganado said, your Node class doesn't need a des... (by dhayden)
my list implementation is very slow (1,2,3)
 
Why is std::vector super faster than my list implementation, and how can I optimize this template <class T> class LinkedList { public: struct Element { E...
[42 replies] Last: Getting back to the original question of list vs. vector (whether you'... (by dhayden)
Making user menu repeat until choose to quit
 
I know this is pretty novice but for the life of me I cannot get this program to repeat itself. Any help would be greatly appreciated #include <iostream> ...
[3 replies] Last: #include <iostream> using namespace std; int ipow( int base, int exp... (by lastchance)
Need a Code for making a Cube design
 
I am searching for c++ code to make a cube design . so do anyone done that before i need help. thanks
[13 replies] Last: hi salem i am using windows 10 (by shawon58)
Courier system using classes
 
Hi, i just need help for the understanding of the following question and no codes please. I will be uploading my classes over here after i get the idea of what...
[5 replies] Last: Following on what Jonnin and Learner2 said, write a draft of your clas... (by dhayden)
Adding text files in Clion
 
Need help adding text files in Clion? or to create them to then write some data? I am trying to add some text files to a program I am working on in order to tes...
[6 replies] Last: I am trying to add some text files to a program If you have a progra... (by dhayden)
Interacting with elements in a given room in a text based RPG
 
So I'm writing a text based RPG using OOP in C++ for a University project. I've designed a class for dealing with the user being in a generic room and taking th...
[12 replies] Last: The reason you are getting that error is because you tried to make an ... (by TheToaster)
Parking system implementation using Classes Test Question
 
I just gave my online test and this question was given to us. I used an function in which an array returns true when it is empty and returns false when it's f...
[6 replies] Last: Thx guys (by A55a551n)
by bibo
Runtime error - using structs in cpp
 
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x),...
[6 replies] Last: Cool. I think i have some bug in logic of my code causing segmentation... (by bibo)
by sfml
How can i make 3D games with SFML anf OpenGl?
 
Just like the question says how can I create 3D games with SFML and OpenGl and set it up with Visual Studio.
[1 reply] : For setting up SFML with Visual Studio, I would go to the site's tutor... (by Ganado)
Namespaces, Enums, Unions, and Struct
 
Hello! I am currently in Data Structures and my teacher did not cover these data types. I am very curious and want to infuse my code to be better with the titl...
[10 replies] Last: C++ made that undefined behavior ^^^ you can only use a union to look... (by jonnin)
Coordinate Walk Program
 
Hey guys! It's my first time here, so sorry if I don't know the rules too much. Please correct me for any errors. My problem is as follows. Given a coordinate o...
[2 replies] Last: #include <iostream> #include <cstdlib> using namespace std; int main... (by lastchance)
by mk7mew
Homework assignment [Help]
 
This is super beginner C++ class, using basic math and loops. I'm having trouble having the code to only have the score to be 1-10 and provide an invalid ...
[4 replies] Last: @maytambo, is that really ALL of your code? It is missing two closing... (by deleted account xyzzy)
by kitfox
How to use smart pointers to maintain a nested hierarchy of objects?
 
I'm trying to figure out the right way to use smart pointers to implement a basic tree like structure. Below is code that shows a basic parent-object-with-many...
[17 replies] Last: Well the reference won't be invalidated while you are holding it, if t... (by TheToaster)
by bsmith
Linked List Destructor Help
 
When running valgrind on my program, it is not showing any memory leaks, however I am still getting the error saying an invalid read of ... . I'm not entirely...
[4 replies] Last: There's no point passing head into destroy. And head should be set... (by dutch)
Using my Timer Class with my Object Class
 
Hello all, Up until this point I had no problem with my 3D Mesh Object class I used for my game engine, however, the larger and more advanced my game engine ...
[5 replies] Last: Nevermind! Someone (alldayeveryday) on freenode's ##C++-general told m... (by TomTheFox)
April 2020 Pages: 123456... 10
  Archived months: [mar2020] [may2020]

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