Beginners - October 2016 (Page 31)

Dynamic array delete
 
Hello guys. I can`t delete dynamic array using delete array; #include <iostream> using namespace std; int main () { int *array = new i...
[10 replies] Last: Thanks a lot everybody! (by White Bear)
Dodgeball Game (Charlie never wins)
 
I made this dodgeball game and it keeps printing out that Charlie never wins. It prints "Charlie won 0% of the time". He is supposed to get around 22% wins and ...
[1 reply] : Move the if on line 99 outside of the while loop (after line 111).... (by coder777)
Can you condense this switch statement?
 
Upon completing this assignment I get this extremely long switch statement. It gets the job done, but I am wondering if there is any way to condense in order to...
[5 replies] Last: Thank you all for the input, I ended up choosing @Arslan7041's idea fo... (by TheRealIronMan)
Read key value pairs in a file and input into a map.
 
I need to input data from a file that looks like this: Asdf 1200 Qwer 4000 Zxcv 3400 Zser 29564 I (think?) I need it in a map container because they are key va...
[2 replies] Last: Well, to optimally read the input file, you would need something like ... (by SakurasouBusters)
help saving to txt file
 
i have been asked to make a gradebook where i ask the user to enter a students first and last name major as well as three assignment scores and their average. I...
[18 replies] Last: using namespace std; but you have std::string , std::cout and st... (by integralfx)
feel like im in a catch22 situation
 
so my assignment is to load a file of US national parks into an array, search for the largest, smallest, oldest, newest. then write the entire array to a new fi...
[1 reply] : The way you output to the file isn't working properly as you have desc... (by Hirokachi)
Help with arrays
 
I have this program I am working on and I need to add a few things on it. I am new to programming and I am going by what books and a few videos say, but I can s...
[3 replies] Last: Huh maybe looking at the following tutorials about arrays, data struct... (by Hirokachi)
Answer only comes out to be 0 from a while loop?
 
Hi, I am pretty new to C++ and I am wondering what is wrong with this code-- I am basically doing a reimanm sum with trapezoids. I think I have the idea down, b...
[3 replies] Last: Thank you- that helped me find my mistake (after almost an hour of fru... (by pinky997)
multidimensional array help
 
I'm trying to create a multidimensional arrays here that is 20 by 10, each row displaying (1, 0, 0, 0, 0, 0, 0, 0, 0, 2) consecutively. But I wasnt able to get ...
[3 replies] Last: Oh wait nvm it worked. I forgot to replace with curly brackets. Silly ... (by clerkolleseum)
Reference Parameters
 
Hello!! I know I am messing up bad somewhere but where exactly I can't tell. Please help!! #include <iostream> using namespace std; void ZombieMove...
[1 reply] : I think you are not returning the values from your two functions!! (by Abhijeet010)
adding a number to a time interval
 
hi, i need help writing a code where it adds 1/8 to every ten years. the direction for this function is as follows, Jacket size (chest in inches) = height ti...
[5 replies] Last: can someone please help me? (by ahsan215)
by jpw84
No C++ IDE I have tried is working
 
I have tried using Microsoft visual studio 2015, code blocks, and eclipse and they all will not let me build and compile. For code blocks I downloaded the "co...
[1 reply] : Maybe your source file is .c instead of .cpp, does this compile for yo... (by closed account LA48b7Xj)
by cm123
can someone help make a loop a do-while loop
 
i have this loop but i need to make it into a do-while loop, does anyone know how to do that? int sum = 10; for(int k = 2; k < 20; k += 3) { su...
[2 replies] Last: @SakurasouBusters how did you get that? (by cm123)
I'm working on a program and it keeps crashing for an unknown reason, please help!
 
I am working on a program that is supposed to completely compress (basically eliminating punctuation and spaces and changing all letters to lower case) reverse ...
[1 reply] : The following code will only take input until the next space character... (by Izink)
having trouble with the intro to dynamic memory allocation
 
i keep getting the error invalid conversion from unsigned int* to unsigned int... im not sure how to use dynamic memory allocation after tutorial so a little gu...
[no replies]
Invalid operands of types
 
I am given an error "invalid operands of types 'double' and 'int' to binary 'operator^'" for my formula in the code "principal = (principal*(interestRate/12)*1+...
[2 replies] Last: Oh I see the problem, I forgot to add pow to that function too. Thanks... (by Praydoh)
Function issue
 
Could someone explain why my function winCount isn't incrementing the win counters? #include <iostream> #include <ctime> #include <cstdlib> const f...
[2 replies] Last: Thanks. I went to my teacher because I was having problems and he wasn... (by Jack816)
Student. Need help!
 
I have a couple of questions through out the code. I will try to ask them. Please help answer the ones possible. My first concern is that is my person.cpp fi...
[1 reply] : Please. Never make the same post more than Once, Stop spamming. http:... (by TarikNeaj)
by bobous
Finding min and max from file..
 
I'm trying to read 12 values in from a file (starting with the number 12) and output the max, min and average number. As you can see I haven't even gotten to th...
[2 replies] Last: Ah thank you very much. That was the exact problem. (by bobous)
Help me with this easy code please :)
 
I recently start to learn some C++ by watching some tutorials on YouTube, I learnt the random number generator and "coocked up" a game with it, I need help with...
[2 replies] Last: Hello guys, Just thinking here: aux is a randomly generated number, s... (by Handy Andy)
October 2016 Pages: 1... 2930313233... 51
  Archived months: [sep2016] [nov2016]

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