Beginners - November 2016 (Page 19)

Can someone explain this code's logic for me?
 
Hi, I need help in this code. I know the logic of this code but can't understand the int n and it's purpose. So here is the code. So the function's purpose is t...
[2 replies] Last: The variable n keeps track of the highest value the loop has encounter... (by Peter87)
Need an explanation
 
Why does the variable starhome change to true everytime we loop even if there isn't any code to make it change to true ? #include <iostream> void outs...
[2 replies] Last: Ah lol, my bad Thanks (by Day Vide)
by Bukk
C++ list iterators incompatible error
 
I'm new to iterators in C++ and I'm facing problem with incompatible iterators. I've spent on this over 5 hours and still I can't figure out why it's not compat...
[no replies]
Find which distance is bigger out of two inputs
 
Solved. Thanks everyone!
[7 replies] Last: Everyone thanks for the help! I got it to work taking all of your advi... (by ninjachachi)
by lubaez
Word Guessing Game C Programming
 
I'm trying to create a code with these prospects: Program that simulates a simple word-guessing game, similar to Hangman (without the pictures) or televisio...
[1 reply] : char phrase[18 + 1] = "these lovely bones"; //[18+1] don't forget th... (by thereare10typesofpeople)
why is this not working i get a problem with the "=="?
 
int var1, var2; if ((cin>>var1)==false) { cout << "Fehler" << endl; } if((cin>>var2)==false) { cout << "Fehler" << endl; } else { ...
[5 replies] Last: thank you very much (by spax1111111)
-nan(ind) and not showing sentinel in .txt?
 
When I start the program and enter 0 as an account number my average gives me -nan(ind). Is there a way to hide this and have it display "No Data"? Also, this p...
[no replies]
Fill in missing functions?
 
Hi. As part of a homework assignment, I am supposed to fill in missing functions without changing main to allow the following code to compile: (This isn't the e...
[4 replies] Last: You have declared operator- wrong. When you subtract two dates, you do... (by dhayden)
Doesn't seem to work for no reason
 
When I run it, it says "expected primary-expression before '='". What is it talking about? Everything seems to check out. #include <iostream> #include <m...
[3 replies] Last: Oh my god thank you this language is horrifying for me. (by Harutyun)
Encrypt and decrypt using rot13 and rot7
 
So I'm writing a program that encrypts and decrypts a text consisting of letters and other symbols. Specification Allow the user to enter a text. All charac...
[no replies]
by Gouki
Help with this code
 
I can't figure out certain parts of this code. Any help is greatly appreciated. Specifically I dont really understand the words array. #include <iostream> ...
[1 reply] : From where you have this? That's a nice exercise testing if someone un... (by nuderobmonkey)
'Else' without a previous if
 
Why does it say there isn't any if before the else command? Tried it several times. btw, this is a program designed to show all the numbers from 1-1000 that ca...
[4 replies] Last: #include <iostream> using namespace std; int main() { int a; a... (by Shahrukhx04)
Replace
 
I'm writing a code that replaces the word read with the word study. So for the first sentence the correct answer will be I'm studying. The assignment requires t...
[3 replies] Last: Thank you Andy! (by markusfurst)
by W3rjg
Storing three names and their batting averages.
 
Hello! I'm working on some C++ homework, and I've hit a little snag. I'm trying to figure out how to store three different user defined names and averages a...
[1 reply] : Make p an array: Players p ; ... getPlayersAverage(&p ); ... printP... (by coder777)
Class Program Issue
 
Hello. I am writing a program that uses a class to ask a user to input a movie name, MPAA rating, and rate it between 1 and 5 as many times as they choose. I ad...
[1 reply] : How come the counters are not being increased by the rating in my obj... (by coder777)
array displaying address instead of double
 
It seems as though everything is working fine except in the end at the function displayTotal (line 113) it displays "'student name' scored 0023F5A8 and got a 'g...
[3 replies] Last: An array is actually a pointer Actually, it's not. An array has an ... (by andywestken)
by roots
Choosing a string from array of strings
 
I am having trouble figuring out a way to select a string from user input. I's like to check an array and see if the string exist. Such as an array with the nam...
[7 replies] Last: If you use a ranged-based for loop you do not need to know the size of... (by boost lexical cast)
Reading in from file to list<string>?
 
Hello, I am learning about lists in class but I do not fully understand to to read in from a file into a list<string> that is a private member of a class. How ...
[5 replies] Last: That error means that iFile.open() returns void (that means nothing), ... (by nuderobmonkey)
palindrome help please
 
i have no idea what i am suppose to do for the output, maybe i am writing the code wrong #include <iostream> #include <cmath> #include <iomanip> #inclu...
[1 reply] : Duplicate: http://www.cplusplus.com/forum/beginner/202570/ Anyways... (by boost lexical cast)
array help, i dont understand anything (1,2)
 
i watch youtube videos on arrays and people are not very precise. what does s.size() do? lets say the user input is in string "GFRTRFG" we want to know if t...
[21 replies] Last: Compiled and tested: #include <iostream> #include <string> #inclu... (by boost lexical cast)
November 2016 Pages: 1... 1718192021... 44
  Archived months: [oct2016] [dec2016]

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