Beginners - October 2017 (Page 3)

How to format output
 
I'm super new at this and need a little help. I don't want answers just some help Q: What is output of expressions(a)&(b): bool p = true, q = false, r = tru...
[1 reply] : Q: What is output of expressions(a)&(b): Try writing some code to t... (by TheIdeasMan)
by cash
How to find number in array
 
My program is displaying number does not exist after each input. I need help to fix my if(TheNum!=cnt) because I know it's incorrect, but I don't know what to c...
[5 replies] Last: You are welcome. Andy (by Handy Andy)
Help with magic eight ball game
 
Hi,I've been having trouble with a magic eight ball game. I'm trying to print a random response and category from a struct but I can't seem to get it to work. T...
[2 replies] Last: Thanks for the help Andy. Everything seems to be working after I adde... (by MarbleHornets)
c++ code help
 
Hi, I have a problem with the spacing for my output. **Here is my coding: #include<iostream> #include<iomanip> using namespace std; int main() { int lower, ...
[1 reply] : Hello bal160730, In line 29 try removing the first "\n" and see what ... (by Handy Andy)
Multiplication table w/ Array will not work
 
Anyone know how to add the top layer of my multiplication table?Plus, if the users enters an integer above 10 i get some weird junk value. #include<iostre...
[2 replies] Last: @ne555 The top part of the table just like the left side. 1| 2| 3| ... (by ZAMZAMZ)
by NovaBp
Why wont the program let me keep inputting
 
why wont the program let me input a value for amount? #include <iostream> #include <iomanip> #include <string> #include <sstream> using namespace std; int mai...
[4 replies] Last: Thanks! (by NovaBp)
Understand GDB error caused by my code.
 
Hello, I'm writing a program that takes an n amount of cubes and builds a tower out of them based on their length and colour but it seems I'm doing something...
[4 replies] Last: Thank you, I don't think I deserve a praise because as a Computer Scie... (by CluelessMan)
Using object as function parameter
 
Can someone please tell me whatsup? I just want to be able to use objects as function parameters, can someone tell me what im doing wrong? In decent terms pl...
[2 replies] Last: Thank you my dude, youre perfect. Havent messed around with c++ in a m... (by MoreUmph)
Constructor excercise problem
 
Hello, i have a problem with an exercise: the header is given: #ifndef HEADER_H_ #define HEADER_H_ class Cow { private: char name ; char * hobby; double...
[3 replies] Last: why the name array do not have a destructor? You don't create 'name ... (by Enoizat)
Undefined reference error
 
I have written a code using parallel arrays to display 20 bottles of bourbon and the corresponding number of bottles sold. The program also outputs the highest ...
[3 replies] Last: I have it working now. Thanks! (by smitty007)
by cash
NEED HELP WITH ARRAY MENU
 
I need help with options 6 and 4 in the menu. This is the menu : 0. Create array: Asks user how many numbers to fill (the length of the partially filled ...
[1 reply] : Helllo, 0. Create array: Asks user how many numbers to fill (the len... (by alonso12)
Breadth-first Traversing?
 
I'm new to binary trees. How would I output the nodes in the trees by levels then from left to right? #include <cstdlib> #include <deque> #include <iostream> ...
[2 replies] Last: How would I change this so that it accepts user input instead of using... (by Griffinflame21)
Define different class function for each member?
 
Hello! I have a (probably) dumb question. Is it possible to have a class and have a method that needs to be written for each member? I'll explain myself: I'm ma...
[3 replies] Last: In the second option, you need to set the function to be executed. You... (by Repeater)
by RNBW
What is wrong with this code
 
I get 2 error messages: Line 13: "a function-definition is not allowed here before '{' token" Line 37: "expected '}' at end of input" I don't understand ei...
[3 replies] Last: With my "This won't work" I meant: What happened in that case was that... (by goldenchicken)
by Ch1156
Final Keyword
 
I was doing some class research and I came across this keyword final. It's the first time i've ever seen it, the description said it was used when you explicitl...
[1 reply] : final is not a keyword ; it is a specifier . It has a special mean... (by JLBorges)
by Hanske
Floating points - Binary
 
Hello everyone, I'm getting started with C++ and programming and want to learn the basics to make sense of the rest of the goodies. I just learned about the ...
[2 replies] Last: Hey thanks for the reply and sorry for just getting around to respondi... (by Hanske)
Displaying and rotating arrays
 
I need this program to rotate the elements in an array to the left, moving the first position to the last position at the same time until the min position retur...
[1 reply] : std::rotate(arr, arr+1, arr+size); http://www.cplusplus.com/referen... (by Repeater)
Problem with code output
 
Hello, I am trying to write a code that will calculate a person's average grade by first asking the grade received and then asking the max grade for the assign...
[4 replies] Last: Please, have a look at the following code (I don't know your data, so ... (by Enoizat)
Integer to string issue
 
I am currently trying to change an integer to a string. I am successful in that, but I am unable to make my program's class return the string without error. It ...
[5 replies] Last: [quote=Repeater]While I certainly agree it's bad form, the page you li... (by Enoizat)
Convert for comparison lowercase variables
 
Hello all, I am trying to convert the string variable 'answer' with a specific array element. They both need to be either all upper or all lower case letters...
[1 reply] : Pay attention to your types:   “answer” is a “string” but ... (by Duthomhas)
October 2017 Pages: 12345... 33
  Archived months: [sep2017] [nov2017]

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