Beginners - February 2018 (Page 2)

strings and loop
 
Input a sentence (with the getline(cin, string) command from before) and an integer value, for the number of time the sentence will print (check for positive n...
[2 replies] Last: Try this cout << "How many times would you like it to be written... (by SamuelAdams)
Getting an error while using 'isdigit();'
 
Hello, im getting an 'exception: std::out_of_range at memory location 0x00AFF71C.' error when program gets to the 'isdigit' function. I dont really see why, sen...
[1 reply] : http://www.cplusplus.com/reference/string/string/erase/ you are callin... (by ne555)
Parallel arrays problem-unresolved externals
 
Hi there, my homework assignment was to create a program that kept track of a companies salsa sales. The requirements were to use two parallel five element arra...
[3 replies] Last: Wow I see it now, Yeah I cant believe I didint catch that one. Thanks!... (by Jason17)
Parameter-passing
 
Hi everyone, I'm new here so I'm I'm doing something wrong please let me know, but I really just need help with a practice exam problem. If someone could walk m...
[2 replies] Last: #include <iostream> using std::cout; using std::cin; using std::endl... (by fiji885)
Critique and Optimize my coding?
 
For this project in my class, we were given a text file with the average weather values for our little town for the first month of 2016. The values were input i...
[2 replies] Last: Usually basic arrays as arguments in functions are passed as pointers ... (by icy1)
Inheritance on cpp.com
 
Hi guys I'm trying to figure out which classes inherit from other classes http://www.cplusplus.com/reference/iterator/RandomAccessIterator/ using the diag...
[1 reply] : The iterator categories are not real types. They are just a set of cri... (by Peter87)
Assistance with switch case/strings for planet program
 
Hey guys, I am new to the forum and have a question on my program. The instructions say to write a program that will calculate how much a person would weigh on...
[4 replies] Last: @coder777 thank you, I fixed that and also managed to change the progr... (by joemcmahon)
by RanGH
P1 vs Computer
 
Hello guyz. I have done my first project about TicTacToe seample game, but now I want to add some new function witch allows u to play vs computer. Now in my pro...
[3 replies] Last: I am not sure where you got that code from, but while it looks like c+... (by Manga)
How can I do this without a nested loop
 
Basically, write a program that inputs an integer n, and applies the following procedures until n=1: if n is even, divide by two, if n is odd, multiply n by 3 a...
[16 replies] Last: [quote=lastchance]Actually it doesn't. Try n=2147483621 ... that OUGH... (by icy1)
Help ASAP C++ calling class!!!
 
I created my Customer class now I need help figuring out how to call it throughout my program. My program first asks you to enter your name I need this to act w...
[2 replies] Last: I apologize for that the first post would not load so I created this o... (by josephhoffman28)
Diagnol array checker
 
i have a 8 by 5 grid. i am trying to check if the diagnol line has 5 'X's in a row. im not sure why my code isnt ending when i enter 5 'X's diagnolly. ...
[2 replies] Last: How about adding a debugging printout on line 7: std::cout << "Now ch... (by keskiverto)
calculator
 
I want to make a simple calculator that can add and subtract integers, and will accept arbitrarily long mathematical formulas composed of symbols +, -, and non-...
[3 replies] Last: #include <iostream> #include <sstream> #include <string> #include <cc... (by lastchance)
Alignment in columns using justification?
 
I know this has most likely been asked a trillion times, but I have had no luck searching topics/forums. I am preparing a code in a for loop and am having diffi...
[4 replies] Last: Awesome, I appreciate the feedback! I guess to narrow down, in the ri... (by Naterade)
Struggling with this code
 
This code is supposed to list if I'm a freshman, a sophmore, etc, depending on numCredits for the students. What happens is, is that for some strange reasons, i...
[5 replies] Last: counting up or counting down does not matter here. The only real diff... (by jonnin)
Algorithm for finding prime numbers
 
I have an assignment where I'm supposed to write a function that determines all the prime numbers greater than 2 up to a user-inputted number and stores them in...
[5 replies] Last: gcd of number & factorial(sqrt(number)) will also work, but the factor... (by jonnin)
by roskee
how to make c++ loop fast
 
I was making a snake game with a cpp code. i created the snake and the borders with a for loop but when i play the game i can clearly see the loop running. crea...
[1 reply] : the console was not meant to run at 80 frames per second :) cls is s... (by jonnin)
by lpetre
Trying to search array for user input
 
Greetings. I am getting 2 errors that I cannot reconcile. ERROR C2664 'int winnersArray(std::string)': cannot convert argument 1 from 'std::string ' to 'st...
[6 replies] Last: Look at this snippet: // Function to build array // Based on Program... (by jlb)
Error
 
main.cpp: In function 'int main()': main.cpp:40:20: error: invalid conversion from 'int' to 'int*' [-fpermissive] revArray = reverse(arr, size); I get th...
[2 replies] Last: Thank you! I fixed the problem by doing this. Also the "reverse" is re... (by iWrestledAnEmo)
Classes C++ Assignment
 
This is my assignment: Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, such as S...
[2 replies] Last: Thank you so much for the help!! (by mysiarobin1987)
why is the next part couldnt show?
 
This code should show Tunjangan, Potongan Iuran, and Gaji Bersih. But, when I clicked this code always stop at gaji pokok. Is there anyone know what wrong with ...
[3 replies] Last: Could you tell us what you're trying to do with that line? (by Repeater)
February 2018 Pages: 1234... 28
  Archived months: [jan2018] [mar2018]

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