Beginners - April 2021 (Page 7)

Structures
 
Hi, I need a little help modifying more for this program. Instructions:(Menu based program) Complex Number Menu 1. input complex number 1 2. input complex num...
[1 reply] : That's a very non-specific question. What is your problem? You seem t... (by lastchance)
Checking whether the number is prime within an interval
 
Using c++, write a program for Checking whether the number is prime within an interval Note: The program isn't working. Can't find what's wrong. int p,q,j,i,n...
[3 replies] Last: Functions are awesome. See http://www.cplusplus.com/doc/tutorial/fun... (by keskiverto)
Wrong values for limits.h constants
 
The constant values displayed at the limits.h page (https://www.cplusplus.com/reference/climits/) are wrong for the S*_MIN macros. So, for example: #define S...
[2 replies] Last: lastchance is correct (*at least, for pre-C++20), but just to give an ... (by Ganado)
Saving an class with a private constructor
 
Hello, I have a problem with this code that is supposed to behave "like a STL set". It's part of a school assignment. When I'm saving integers or strings, it w...
[6 replies] Last: Thanks, great code! Works at 100%. (by mafu1212)
Iterator in linked list
 
Hi, This is the first time using an iterator. I am trying to implement one for my linked list but I am stuck on the begin function. My compilation error is "'I...
[4 replies] Last: I understand now. Thanks alot, Sensei! (by jaffe15)
by abuh
please help me
 
Question#1: Create a Customer class that includes fields for last name, first name, and postal code. Include a default constructor that initializes last name...
[5 replies] Last: I want help to write this content code What help do you need? What... (by seeplus)
Lowest value not printing
 
Hello, I'm working on this assignment and the instructions are to ask the user to enter 10 numbers and store it in an array. Then we're supposed to print the nu...
[3 replies] Last: The easiest way to find the lowest and the highest number is as the nu... (by seeplus)
by NiceS
Error in reading text file
 
Im trying to read a set a data from text file in a structure array. However my code works fine with all the other data pass the first one where it reading 0001 ...
[6 replies] Last: Instead of .ignore(), you can use >> ws to skip all following white-sp... (by seeplus)
Do while loop guessing number
 
the user can guess at more than one magic number where the magic number is an integer between 1 and 20. When the program is run, the user should be prompted if...
[4 replies] Last: Hello Winniehuangfu, To start with I am thinking you could start wit ... (by Handy Andy)
by NiceS
using std namespace for a line
 
Im wondering if there is a way to use std namespace for just a specific line instead of typing std:: each time it is required in the same line ? this is just...
[1 reply] : "using" statements only apply to the scope they are declared in, so yo... (by Ganado)
by Ch1156
Using reserve() on vector
 
Im reading through C++ Primer 5th edition and i've reached chapter 9 on Sequential Containers and it mentioned something on reserve and Size and capacity, and I...
[3 replies] Last: For 500 items, I'd say it's not a big deal. The time required to add ... (by dhayden)
Saving values from a .dat file into a matrix
 
How do I write a program that saves values from a .dat file into an array? I have a .dat file with 6 rows and more than 10000 columns. I want to store the co...
[2 replies] Last: Hello fabstr1, Some things not mentioned yet: The C header file "<st... (by Handy Andy)
Memory allocation
 
Hello, I am writing a project that will read from an assortment of text files that create a menu and can read from it. I am getting the main menu to show but ...
[7 replies] Last: Thanks for the info! I've being using noskipws with buffer iterators s... (by seeplus)
Arrays with Filestream
 
This is what I am trying to accomplish C++ HW - Files and Arrays Create two 10-element arrays (1 is empty for now 1 is what the next line is) Using a ran...
[8 replies] Last: I can confirm he wants every number multiplied by 2 not double vs int (by nickmcp11)
by dune
getline falling through
 
I have this bit of code that's suppose to capture a string entry: void setTitle() { string s; cout << "Book Title: "; getline(cin, s); tit...
[6 replies] Last: .ignore() will clear one char from the buffer. As sel is of type char ... (by seeplus)
by dune
Is there a better way?
 
I have a some if statements nested and was wondering if there's a better way to handle this. What I have works perfectly fine, but maybe there's another way, o...
[6 replies] Last: #include <iostream> #include <string> #include <algorithm> #include ... (by seeplus)
How to insert 25 at the beginning of the the line
 
How would you add 25 at the start of the line instead of next to 10. in the same type of cpp. the c-ish cpp. like: 10 15 20 25 25 10 15 20 25 instead of: ...
[1 reply] : #include <iostream> #include <string> using namespace std; struct ... (by seeplus)
How to arrange and find average, max and min values in 2D array?
 
Hello, i have been assigned a coding exercise to use a 2d array to make a CPP program that stores rainfall data. I have to store rainfall data for the last thre...
[6 replies] Last: thanks very much, it worked! (by Scayron)
by akeilo
Help with functions
 
I need help figuring out why it won't output my last function. #include <iostream> #include <fstream> #include <iomanip> #include <string> using na...
[1 reply] : Where do you call report()? (by AbstractionAnon)
by abuh
please help me
 
Write your question here. i want to Update the program to add a menu for choosing the operation (Search Data, Add a Record, Update Data, Quit) ....... #i...
[13 replies] Last: ...I am not entirely sure what you mean...? (by JRManx)
April 2021 Pages: 1... 56789... 12
  Archived months: [mar2021] [may2021]

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