Beginners - October 2020 (Page 8)

by ebz
How do I free memory a vector has used up?
 
I'm not sure how to free memory a vector used up. For example I have a vector like this: std::vector<Texture*> textures; When I try deleting them si...
[10 replies] Last: Thanks you all for your great replies. It really helped a lot! (by ebz)
correction?
 
I wrote this for a brief clarification for myself, are those define correction? data // Data is any sequence of symbols (numbers, letters, etc...) th...
[2 replies] Last: Wow, I definitely didn't read that tutorial carefully. Thank you (by soulworld05)
by jax16
Wanting to print all inputs
 
Howdy, I am wanting to print all these choices. I set them to 4, and at the end of the 4 choices, I would like to print all the choices made. How can I go about...
[6 replies] Last: Is this what you want?? #include <iostream> #include <limits> int ... (by seeplus)
Binary Tree complications
 
I'm having a number of issues with my program. I apologize now, if this is not the proper way of doing this. Below will be the issues, spec sheet, infile data, ...
[5 replies] Last: What compiler/os are you using? Now is the time to get to grips with ... (by seeplus)
A certain global isn't "recognized" inside of a certain function
 
Time-appropriate greetings! I have ran into a weird issue: A global variable isn't "recognized" by a certain function. It works everywhere else, in all oth...
[4 replies] Last: I know, I just copy/pasted the parts of that fuction here that had tha... (by leander g)
srand always outputs the same number
 
Time-appropriate greetings! I am curently a bit stuck with trying to get a function to generate random integers in a certain range. I looked at some tutoria...
[12 replies] Last: Using rand/srand is noob easy, <random> and <chrono> can be a bit hard... (by deleted account xyzzy)
by NowIC
Biggest value of variable is always 0?
 
I am re-/learning and want to get better in C and wrote a short program which purpose is to give the biggest value of 10 entered values. The thing is that I alw...
[5 replies] Last: Thanks all. Now I understand. Little thing with big impact. Didn't kno... (by NowIC)
Beginner here wondering where to start with this assignment.
 
Wondering where to start on this C++ homework assignment involving friend functions and overloading operators implemented in a Rational class. These are the ins...
[2 replies] Last: Hello ethanbonneraustin, You should start with following your instruc... (by Handy Andy)
Returning vectors of vector
 
Hi all, std::vector<float> TEST() { std::vector<float> ws; std::vector<float> space; int count =0; // Do stuffs ...
[2 replies] Last: You can return the two vectors as a pair then extract when the functio... (by seeplus)
Set Precision
 
Hi all, How to set the precision to 2 digits for floating point numbers in cpp? for ex: float x = 45.223455666777; I want to set to 45.22 How to do it w...
[10 replies] Last: Thank you all for the reply. (by Shruthi LS)
reading several files and testing the model consecutively
 
Hello everyone, I am quite new in C++ and need to learn some new features and I need your help for a problem. I have a small mathemtical model which is solved...
[15 replies] Last: I need to press any key after each Ins_.dat file has been treated T... (by seeplus)
Practicing creating choices
 
Hello! I am currently practicing on creating programs that will run and put the user to a menu that will output grading systems. this is the question but i ...
[4 replies] Last: Well done. Now for the green tick and move on. (by againtry)
Simple mistake with static cast
 
I am writing a program using binary tree. I have an average to display, but each time I call it, the error produces "conversion from int to float, possible loss...
[11 replies] Last: [quote=ne555]we are rubber ducks ROFL! That link is definitely a kee... (by deleted account xyzzy)
setf() and flags()
 
Hello, I wonder what the difference is with these functions. setf() - fmtflags setf(fmtflags flags) - says the function returns previous settings of flags a...
[4 replies] Last: Great, thank you for help. (by MyOnlinePersona)
tutorials confuse
 
This step in tutorial https://www.cplusplus.com/doc/tutorial/constants/ I'm confuse since there isn't many example for all those new terms, also I don't real...
[4 replies] Last: I checked Learn C++ its truly is better at tutorial. Thank for the rec... (by soulworld05)
Finding time complexity of a nested loop
 
Hello everyone! The outer for loop will run "n" times, then second for loop will run n^2 times if I am not wrong (because it's running 1 time, then 2 times, 3.....
[14 replies] Last: https://stackoverflow.com/questions/18656270/runtime-analysis Throw i... (by deleted account xyzzy)
by derimo
Displaying average from user input
 
Im having trouble with an exercise. I am supposed to ask the user if they want to input a real number. If they answer yes then prompt them. I have that part, bu...
[4 replies] Last: You can shorten the code by putting the loop condition in the middle o... (by dhayden)
Have you ever used goto in commercial software?
 
I remember first using goto several years ago when I first started. I can see why it's not very pleasant to use as it could easily lead to spaghetti/confusing...
[12 replies] Last: it does require you to look upwards and scan for keywords though. I... (by dhayden)
bitmask enumeration?
 
hi, I am learning about formatted I/O, and really struggling to follow what my book is talking about. It says that fmtflags is a bitmask enumeration. I dont rea...
[15 replies] Last: This is how it works: #include <iostream> using namespace std; int... (by againtry)
pointers to function in a struct and functions calls (display info about student struct)
 
So I have an exercise in C++. I have a structure student with the following members: 1 int, 2 char, 1 float and (I write the lines from the exercise): "two poin...
[3 replies] Last: Very nice, I was considering building an example like that, too, but d... (by Ganado)
October 2020 Pages: 1... 678910... 13
  Archived months: [sep2020] [nov2020]

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