Beginners - March 2021 (Page 9)

Help
 
Write a C++ program that prompts the user to select one of three television models and provides a description of the models. Use the switch control structure to...
[6 replies] Last: #include <map> #include <string> #include <iostream> struct Info{ ... (by seeplus)
by lapsa
Help needed urgently
 
Hello, folks! I am desperately looking for some generous soul, who could help me with a couple of very very c++ basic examples! I will receive the task to...
[5 replies] Last: Of those questions, the one you may not be aware of is ceil(). This ro... (by seeplus)
possible double free error
 
I could use help determining whether an error is related to freeing memory or (somehow) to getting input by passing two files as arguments from the command line...
[4 replies] Last: Thank you! It runs without error when I make the change suggested by c... (by juseniah)
max/min of an array of OBJECTS
 
I am writing a code using class ( objects ) which will display a menu consisting of 6 options like : 1. create an array of "n" elements objects 2. display...
[10 replies] Last: @keskiverto , I was trying to access private/protected zone using a fr... (by MaxGreen)
Use 100% of my CPU
 
Hello! I have an Intel I7 dual core 64 bit. I am compiling a relatively long C++ code in Visual Studio Community 2019. Looking to statistics just 25% of the ...
[7 replies] Last: Interesting, I will try to implement this. Thank you Salem C. (by NicoRos)
While loop using an array
 
I have most of the code after this written but I just need this one part to work in order to move on. while (storeArray != -999) { cin >> storeArray ; i...
[7 replies] Last: #include <iostream> int main() { const size_t MaxArr {20}; const ... (by seeplus)
Help understand for block
 
Write your question here. #include <iostream> using namespace std; int main() { const int numsToCalculate = 5; cout << "This program will calcu...
[15 replies] Last: Lets run your program: This program will calculate 5 Fibonacci Number... (by keskiverto)
Code giving me a blank console
 
The goal is to make a random war game each time you run the program. I already got it working before using if statements but I need to do it with switch stateme...
[3 replies] Last: @Aftertimewaster, PLEASE USE CODE TAGS (the <> formatting button to ... (by JRManx)
A Pointer question.
 
suppose i want to swap two pointers of two variables this code which i think the correct one, does not swap the numbers(orders does not change): #includ...
[2 replies] Last: Why does not work the first code? You need to pass the pointer by ref... (by coder777)
random numbers
 
Hello, I wrote a recursive function and I don't know if it is the cause that the random naumers seems don't work. That is to say it works one time but as they a...
[1 reply] : > unsigned int seed{0}; > srand(static_cast<unsigned int>(time(0))); ... (by salem c)
Is it possib le to incremennt a pointer value (not the address)
 
Hello guys, is it possible to increment the pointer value like this? int main(){ char* str = "Hello WoRLd! Today’s temperature is 34°C."; ...
[4 replies] Last: Ok i fixed, thanks to you guys!!!!!! :DDD (by vittorioc98)
by pstein
Basic questions about VC runtimes and compatibility
 
I have read now for a while about VC runtimes but did not found a satisfying answer for the following questions: 1.) If I run a 32bit program (which needs a ...
[2 replies] Last: When you talk about 'runtime' you presumably talk about a dll. The sys... (by coder777)
Switch statements (going straight to default)
 
#include <iostream> using namespace std; int main() { int nextChoice; cin >> nextChoice; switch (nextChoice) { case '0' : ...
[3 replies] Last: Consider: #include <iostream> using namespace std; int main() { c... (by seeplus)
Tax return calculator
 
Hi, I'm fairly new to coding and ran into a problem in which I don't know how to do. I just started a little over a month ago and I have no clue how to make spe...
[2 replies] Last: Thank you so much, I tried that a before but I forgot to use another =... (by bdkaleb)
by maple
confused about std::forward
 
Hello everyone, I am learning about std::forward which is confusing. The returned value type of std::forward keeps all the traits of its parameter. If the rea...
[3 replies] Last: Guess it is like this... Yes, you got it. (by mbozzi)
by Ch1156
How to iterate through a vector of tuple and remove duplicate indexes
 
I have a vector of tuple and I push back an item in it, then if i push back the same item, i want it search the vector of tuple and if it finds the same item, t...
[5 replies] Last: Would I just be able to use composition? This is a very basic example... (by Ch1156)
Input a string into char
 
Hello! I have an assignment requiring me to read from a .csv file into a struct array, sort the array by various methods, and display the information. One of th...
[3 replies] Last: [Also see http://www.cplusplus.com/forum/beginner/276676/ ] (by seeplus)
Reading from a .csv file to an object array
 
Hello! I'm trying to read from a .csv Excel file into my code to be displayed in a cout. Currently in my classes we haven't been taught about vectors, classes, ...
[3 replies] Last: [Continued from http://www.cplusplus.com/forum/beginner/276679/ ] (by seeplus)
Please Help!
 
PLease help i dont know why but it keeps saying there is no matching functions to index_of_smallest and i need to finish this program before midnight! #incl...
[2 replies] Last: There is std::swap() to swap two variables See http://www.cplusplus.co... (by seeplus)
newbie’s questions
 
Hi masters, can you please answer these questions for me? I’ll really appreciate your help. 1. What is the difference between break statement and continue sta...
[1 reply] : https://duckduckgo.com/?q=What+is+the+difference+between+break+stateme... (by salem c)
March 2021 Pages: 1... 7891011... 13
  Archived months: [feb2021] [apr2021]

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