Beginners - October 2020 (Page 4)

confirming
 
Hi again, I want to make sure I get it right. For this line 3 the one with nothing in the parameter. Is not necessary because we already used return input;. ...
[8 replies] Last: Thanks! (by soulworld05)
C++ is not right (1,2)
 
HI People, I am just learning C++. I have a couple of books that I am learning from. I think there is something wrong with Visual Studio 2019 Pro. I write progr...
[39 replies] Last: Compiling your first program - https://www.learncpp.com/cpp-tutorial/w... (by George P)
How can I rewrite function add to be more efficient?
 
Write your question here. Is there a faster way to accomplish this? It's fine if the vector is small but not as much when it gets larger. class school ...
[2 replies] Last: If the standard comparison for std::set isn't what is required, then a... (by seeplus)
Are they made changes to getchar() recently?
 
Why does these authors claim that getchar() acts in this way? Their book is from 2014. In its current version getchar() work just as expected - it read buffer's...
[3 replies] Last: " You would think that if the user typed GT, the G would go in the var... (by Emil Enchev)
tutorial confusing
 
this is what tutorial say Start with: 42030 Slide decimal left 4 spaces: 4.2030e4 No leading zeros to trim: 4.2030e4 Trim trailing zeros: 4.203e4 (4 signi...
[4 replies] Last: so they are significant That's indeed true. Confusing precision with... (by againtry)
hello world
 
Hi! im creating something i like to call a complex hello world. im extremely new to coding let alone c++ and to start i made a hello world. i know how to do tha...
[4 replies] Last: @doug4, Nice input. Thank you. I will try to that point in the future... (by Handy Andy)
loop while
 
Hi there, I'm trying to write program in wich i measure a signal to switch on/of a relais. the relais should inmediate turn on if there is a signal, if there is...
[7 replies] Last: Thank you all. I have learn't a lot. Amazing how you turned this"probl... (by theBenz)
Amortization table
 
I'm doing an assignment where I have to create an Amortization table. I personally have no clue how loans work but gave it my best shot when writing the code. I...
[9 replies] Last: $12.43 is safer as 1243 cents. Trust me on this :) You can find cou... (by jonnin)
I/O streams & std namespace
 
Hi, I am trying to learn about the IO streams and have a question regarding that and std namespace. From this page It appears that all the streams inherit from ...
[4 replies] Last: Thank you for the help, I will look into the link. (by DonnaPin)
Arrays within a function
 
Hello, im being asked to create a user defined array. Ive gotten that code down, but im having trouble defining the array within a call function. If anyone know...
[4 replies] Last: yeah my terminology with c++ is trash. Still new to the language and h... (by liam401)
Code help
 
!!!
[6 replies] Last: Thank you so much for your help! (by yogagirl)
How to read from a text file and split it into values in C++
 
this is my text file (mytext.txt): rho_0,10 kp_0,8 Beta_kp,6 x_min,5 x_max,8 y_min,9 y_max,5 z_min,4 z_max,7 I want to read from this text file line...
[7 replies] Last: Yes, thanks alot. Now it's working :) (by Amirreza10)
Templates in external files doesn't work well
 
It works but when i try to move class and methods to separate files it throws errors #include <iostream> using namespace std; template<typename T> class T...
[1 reply] : All templates need go to the header file. https://stackoverflow.com/qu... (by Thomas1965)
Sorting
 
Is this possible to arrange given numbers in ascending order with if statement ? I have tried but, because of if else , it only prints the smallest of them b...
[9 replies] Last: Andy , thanks for your vast answer. I really appreciate it. I learnt ... (by HelpMeBro)
How to read this type of name in file i/o c++
 
Recently i have learnt how to read file and store data to the class in c++. But there a harder exercise that i have no idea to do. Here are the text file Id ...
[2 replies] Last: A simple way to do this could be: #include <fstream> #include <iost... (by seeplus)
Why won't my ofstream make a new file with the context??? It only makes a blank file?
 
My input file is "widgets.dat", how do i close the program when done & rename/re-create a new file as prog2.out. struct Item { int partNumber; /...
[19 replies] Last: Thanks for the support, you guys are freakin awesome! Have an amazing ... (by FanOfThe49ers)
What are some design patterns that appear in your code often?
 
Hello, I wanted to ask this question because I think it's interesting to hear about other people's experiences. Have you always had one or two design patterns t...
[6 replies] Last: @syeare, one way to avoid if-else is a look-up table. The code snippet... (by Thomas1965)
My structure file only displays the last line of my fstream files. I also question abo (1,2)
 
Hey all, i want to finish up my code without changing much since my teacher requires us to keep it in the same format with mostly the same functions. But for so...
[20 replies] Last: post all your updated code you need to fix at least three things: - ... (by ne555)
by syeare
Input Validation Loops: Strange Behavior
 
I don't understand why my console spams a bunch of couts when I input a character instead of a value. It works perfectly fine if I input a value not within the ...
[5 replies] Last: cin is how C++ interacts with standard input , which is essentially a... (by Ganado)
Press any key continue automatically
 
Hello everyone, I will be very happy if you can help me for a problem I face with. I have written a C++ code to read a multiple data files in Visual Studio in...
[5 replies] Last: Thank you so much @Handy Andy and @Ganado . The problem has been solve... (by learner999)
October 2020 Pages: 123456... 13
  Archived months: [sep2020] [nov2020]

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