Beginners - October 2020 (Page 6)

declaring unknown amount of variables
 
I help to understand how to declare variables for an unknown amount of inputs and displaying "Enter an integer" for each of the unknown amounts of variables. Is...
[9 replies] Last: I help to understand how to declare variables for an unknown amount o... (by keskiverto)
Sort help
 
Need some help with Bin Sort/ Radix sort. I know how the algorithm works now but I wonder why it doesn't work in my code. It gave me an error in the third coun...
[4 replies] Last: Ganado thank you I fix all the problems! (by LmaverickD)
Can i have some help?
 
Write your question here. i can't input but i declare cin in my codes, im doing an payroll system codes and i have to pass it til 5pm gmt+8 #include <iostre...
[2 replies] Last: mixing cin and getline can lead to trouble. Google that for how to fi... (by jonnin)
making a char print as to two digit hex
 
This is what I thought up to print a char as a two digit hex, is there an easier way/better way? #include<iostream> #include<iomanip> #include<sstream> #incl...
[5 replies] Last: Thank you, for your time, if was very helpful. I had do some thinking,... (by closed account oivD8vqX)
remove void?
 
I tried to do this without void, seem to give error. Is it possible to not use void? Reason is, the int number has no use if I didn't give it anything to do. ...
[1 reply] : Wow nevermind, after few attempt I solved it. #include <iostream> ... (by soulworld05)
by Rhyzan
no suitable conversion function from "std::string" to "std::string*" exists
 
Hey all, I'm currently taking a c++ course, I've tried asking my prof, but have only gotten unhelpful responses. Hoping for some insight to my issue or possibl...
[4 replies] Last: Yeah, I'm seeing that it's an issue of I didn't read/understand the di... (by Rhyzan)
Istream get() null terminated wording
 
Hello. I learning istream get() but do but understand wording of explanation. Could someone please help. It say Istream &get(char *buf, size n) "The a...
[5 replies] Last: char str defines str as a char array of 256 chars. As it is not initi... (by seeplus)
Setfill Command
 
Can I give space in within setfill command? I wanted to write like this with space * * * * But not like this **** without space. Here is my code. #incl...
[4 replies] Last: Yes like yours one. * * * * * * * * * * * * * * * * * * * * * * * * ... (by HelpMeBro)
Parsing and comparing argv
 
Hello, I am trying to iterate through argv using for loop, but when I try to compare argv to a string, there's no result, that means false, but when I just pr...
[4 replies] Last: for (int i = 0; i < argc; i++) { Small point, but as argv is the... (by seeplus)
by forfor
function not declared in this scope
 
So, I'm making game frameworks for my own amusement, and I've hit a snag that I can't figure out. There are three functions that as far as I can tell are perfec...
[9 replies] Last: No prob. (by seeplus)
Do While Loop to Repeat Program
 
With my program, it is supposed to collect a student's 5 grades and get the average. I've figured out that part with assistance. The second part is to ask if th...
[1 reply] : The do...while loop goes around lines 9 - 27. You don't need i defined... (by seeplus)
Nested while loop
 
I need to make a while loop that produces the following pattern: * ** *** **** ***** ****** I've tried using a nested loop, but I'm not doing it right or comple...
[8 replies] Last: #include <iostream> #include <iomanip> using namespace std; int mai... (by seeplus)
manipulators - using ios::
 
Hi, I am learning manipulators, and I have a few questions about when to use ios::. I understand I need to use this for the manipulator to have access to its 'b...
[2 replies] Last: @DonnaPin The reason ios:: is not being used in the examples, if that ... (by againtry)
ostream write()
 
Hi, I am trying to figure out a piece of code, and one line is confusing me. I have put the code below. The line that I am confused with is the out.write. I bel...
[3 replies] Last: Why not try it yourself? It won't compile if you don't cast it. ofstr... (by Ganado)
How many trees can they plant
 
I wrote a program that I am not sure if the math is right. Write a program that prompts the user to input the following: a. The length of the yard. b. the ra...
[4 replies] Last: Thank you looks like that is what I needed .... again thank you. (by james58)
Square root and while loop trouble.
 
Hi, I have to find whether or not two numbers when added and subtracted together make perfect squares up to a user inputted integer. I have searched everywhere ...
[1 reply] : No idea why isdigit() or isalpha() would be of any use to you. You ap... (by lastchance)
How to find squares of odd numbers in an interval
 
How would I write a for loop that finds the square of all odd numbers in an interval? I figured out all the other steps, but this is the last thing that I need ...
[2 replies] Last: #include <iostream> using namespace std; void odds( int a, int b ) {... (by lastchance)
Pointer to Object in C++
 
Hello, I expected the result will be 12 but I have 11. I traced the program and p has the address of y but point to X object. #include <iostream> using nam...
[2 replies] Last: @helios Thank you and edited first post. (by Shervan360)
For Loop to Collect 5 grades
 
Hi, while I know homework questions are shunned upon, I have been struggling for the past few days. With my code, I'm supposed to enter 5 grades using a for loo...
[2 replies] Last: Thank you for going into detail on what I did wrong. I ran my code wit... (by Amnesiax)
Deleting objects in template class
 
i've got my template class template <typename T> class List and there's a method void clear_list(bool flag) { if(flag && std::is_p...
[2 replies] Last: List<Student> *students = new List<Student>(); /* add random students... (by Alex12361)
October 2020 Pages: 1... 45678... 13
  Archived months: [sep2020] [nov2020]

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