Beginners - February 2021 (Page 3)

Remove first node of the linked list
 
What should I change in my code so programm would delete first element from the list? void single_llist::delete_pos() { int pos, i, counter = 0; ...
[2 replies] Last: Sometimes your code calls free(s) when you haven't freed anything. Som... (by dhayden)
Assigning a name to ecah componnet of 3D array
 
Hello everyone, I have a 3D array which I want to give name. I do, but it gives me an error about BestX (says that it must be a class ,what is wrong here? Can...
[2 replies] Last: Also, line 6 should be sprintf() , not printf() Why do you want to... (by dhayden)
by mxkxx
how
 
Sample Output:Enter 5Exam Scores: Exam Score No. 1 => 91 Exam Score No. 1 => 75 Exam Score No.1 => 85 Exam Score No. 1 => 55 Exam Score No. 1 => 90 how ...
[2 replies] Last: it works! thankyou very much for your help! (by mxkxx)
SDL_TTF update text each cycle - better solution?
 
Hi there So I have created a score overlay for my game that displays the current score using SDL_ttf. However, in order to always have the current score displ...
[1 reply] : Instead of creating a new SDL_Surface and creating a new texture from ... (by helios)
Reading from Input File
 
Hello all! I'm in the final stages of debugging a project, but I seem to have hit a wall and would greatly appreciate your assistance. As part of the project, I...
[4 replies] Last: #include <iostream> #include <fstream> #include <cstring> using names... (by lastchance)
include\Term.h|8|note: candidates are: 'constexpr Term::Term(const Term&)'| ???
 
How do I fix this error in my .cpp file? C:\Data structures-r\Polynomials Lab\src\Term.cpp|12|error: no declaration matches 'Term::Term(double, int)'| ...
[4 replies] Last: Taking a break can be a big help too. (by mbozzi)
Need help with first code.
 
Hi! I just started learning C++ as my first programming language. I started by writing my first code, but I ran into an issue. I'll leave the entire code belo...
[5 replies] Last: Welcome to C++! tags are special sequences that inform how the text i... (by seeplus)
Writing the values on a txt file
 
Hello folks, I need a small help for writing the varible x at each iteration but I do not know how to do that. I have a function to update the value of x ...
[7 replies] Last: Thank you so much @lastchance, I realized my mistake and I opened the ... (by learner999)
Digits after decimal place.
 
Hello so I got this code here to count the number of digits in a number such as 52 has 2 digits or 793 has 3 digits. I just dont understand how to do this with ...
[4 replies] Last: Handy Andy, Lastchance, and Seeplus; thank you for all your help. Got ... (by Winslow1342)
QDoubleSpinBox not giving correct result
 
Hi, I have completed a temperature conversion C++ program. It gave me the correct converted amounts when I use lineEdit but when I use a QDoubleSpinBox it gives...
[6 replies] Last: double celsius = ui->celsiusLine->value(); assuming that ui->celsius... (by keskiverto)
Vectors change addresses, is reserve the only solution?
 
tldr: On the curious side, why do memory addresses of all the elements in a list change whenever I add an element? On the practical side, what advice can be g...
[2 replies] Last: Thank you, I see the tradeoff is the std::list is a linked list and is... (by StMiles)
by renpo
don't understand
 
Can you please help me understand why this code returns the one statement from the if and another from the else? This is true! That's all folks" #inclu...
[3 replies] Last: I'm kind of surprised your compiler didn't even give you a warning whe... (by JRManx)
by JRManx
Encrypting program using C-strings
 
Hi! I'm trying to write a program that encrypts a user-entered message using two C-strings, one is a regular alphabet, and the other is a special one. So what...
[14 replies] Last: @jonnin After initializing to zeros, the output was still OPENINGAAA... (by JRManx)
lambda question
 
I am learning about lambdas and confused about a few things i am being taught. I have read that a lambda is a functor, which I think is basically a class that h...
[11 replies] Last: Ah, you name your lambdas in those examples. I see a lot of unnamed o... (by jonnin)
Just ran into my first "Program Received signal SIGSEGV" error. Some thoughts ...
 
So, I am just minding my own buisness and trying to get some code to work when suddenly the debugger tells me that "Program Received signal SIGSEGV". Apparentl...
[10 replies] Last: they have seemingly random values consider yourself lucky. If it wou... (by leander g)
Print items in structure with quantity < 10
 
Hi, i'm stuck trying to iterate through a structure, what im trying to do is print to a file items whose quantity is < 10. My file looks like this: 1 apple 1...
[4 replies] Last: If you still have problems, post your code. (by seeplus)
help for the following exercise
 
hi I started programming a few weeks ago and I need help in the following exercise Write a procedure that prints an integer an operator (+ - / *) and an inte...
[3 replies] Last: I need help in the following exercise What help do you need? Can yo... (by seeplus)
by L67GS
Duration of audio files
 
I've been looking for a way to derive audio file duration in milliseconds for nearly two days to no avail. Actually what I'm trying to do is mix audio on the f...
[5 replies] Last: Oh yeah I see the sledgehammer, I'm not against using ffmpeg so much a... (by L67GS)
Store text lines from a file into a char array
 
I'm trying to modify this function so it will read lines of text from the file that the user is prompted to enter and store that line into the buffer array so c...
[5 replies] Last: Exactly what I needed. Thanks seeplus! (by ejulien18)
C-string vector acts differently than std::string vector?
 
Please consider the following example code: #include <iostream> #include <vector> #include <string> #include <sstream> int main() { std::vector<std::strin...
[17 replies] Last: It was just meant to highlight that _exec??() is used with VS rather t... (by seeplus)
February 2021 Pages: 12345... 12
  Archived months: [jan2021] [mar2021]

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