Beginners - October 2014 (Page 2)

bubble sort help!
 
I need help sorting an array from an input file. After reading the scores into the array from the file, use a bubble sort to sort the array and display all of t...
[1 reply] : http://www.cprogramming.com/tutorial/computersciencetheory/sorting1.ht... (by mobotus)
[VC++] Program does not take variables from other class
 
I just followed TheNewBoston's tutorials and made another class and header, but when I include header and write strings in cpp file, nothing happens. I am using...
[8 replies] Last: Yes, sir. #include <iostream> #include <string> #include <random> #i... (by Nicholas1010)
Need a little assistance counting a sort
 
I am writing a program that will sort two separate arrays of 20 integers one as a bubble sort and the other as a selection sort. The program works great but, no...
[6 replies] Last: Thanks to everyone for the help! (by guglaak)
Beginner problem
 
hey guys im studying about recursion by myself and i want to make a recursive function that prompts the user to input the base and exponent and generate the fin...
[4 replies] Last: tnk you so much! (by theposibility)
How can I make this code 2 dimentional array?
 
Hi all, The code below calculates the dx/dt=u equation by euler method. This calculates the u for the position of each particles (np) and calculates the distan...
[4 replies] Last: x ; you can get them using x[n-1][m-1]; you can try using it in vecto... (by rjvc)
Self taught, wondering why this isn't working
 
In school, we were given an assignment to write an essay in an interesting way, so I decided to program one in c++. To make it impossible to read the essay with...
[3 replies] Last: I'm running the program from Visual Basic, and the console output only... (by Deskarano)
strings and ints
 
if I have a string like "toenuts" and I had have "t" an integer and made it equal 2, then how can i convert that "toenuts " into an integer so that it will equa...
[2 replies] Last: So you want to map specific characters to specific ints? This might he... (by MiiNiPaa)
Can someone explain why I get this number?
 
Running my code I get a number close to -8 million or so.. I'm sure it's not supposed to be that small, in fact it should be between 0 and 100. #inc...
[5 replies] Last: Congratulations! Now you might want to make the code even better by h... (by dhayden)
How to I loop back to my main menu with my switch statements?
 
Bear with me, I'm still pretty new to C++... So my dilemma is that I have a menu for 2 games, both within their respective switch statement/cases. The code w...
[3 replies] Last: Since you're still new, you could try cascaded/nested loops of for or ... (by rjvc)
Linked List
 
I have been given an assignment to add to an already given program. I have been told to add the following: "isEmptyList, print, destroyList, deleteNode and inse...
[1 reply] : I have been adding to the program but I come up with errors. A couple... (by kbw)
by BB2921
Extracting numbers from .txt file into array.
 
I figured out how to place the file, but whenever I try to extract the txt file and put it into an array it messes up. Can anyone help? Thanks. I left out some ...
[7 replies] Last: Awesome thanks, I'm just an idiot and didn't have matching files.txt w... (by BB2921)
problem please
 
Write your question here. #include<iostream> using namespace std; int recursion(int x); int main() { int x=1; cout<<"The number in the main : "...
[5 replies] Last: thanks for helping guys (by theposibility)
svaing my information to .dat file
 
i have wrote my code which ask for weight and height but every time i enter my information which will replace the previous information from my .dat file I want ...
[1 reply] : Input/output with files: http://www.cplusplus.com/doc/tutorial/files/ (by anup30)
Having trouble alternating users in chip game.
 
Hey, I am having trouble alternating users when I ask them to take chips from the pile. The program compiles and runs, it is just not near complete. I'm just st...
[3 replies] Last: //A Question : if player1 takes all chips on first turn, he wins imme... (by anup30)
the heap space
 
Hello i don't understand what the author of my e-book is saying about the heap below, can someone please try and explain it and how the "new double" works? ...
[2 replies] Last: They are part of dynamic memory management. how the "new double" wor... (by rjvc)
Generating Yearly Calender
 
So I am writing a code to generate a yearly calender based on the year put it in and the day of the week January starts on, and it takes into acoount whether it...
[2 replies] Last: found it http://www.cplusplus.com/forum/general/113651/#msg620789 (by Duthomhas)
squareRoot functions don't work fine
 
I have to calculate the hypotenuse of a triangle and I need a function that returns the square root of its argument. But I don't want to use <cmath>, I want to ...
[2 replies] Last: Thanks a lot dhaylen, I once have tried return r-0.1; but it didn't ... (by WilliamLycan)
trouble with functions and pass by reference
 
My computer science class has this very specific homework assignment and I don't understand how to do all of it. Write a program that will calculate the aver...
[5 replies] Last: Technically first and last become local variables in the main() functi... (by dhayden)
Having Issues With Writing to a File
 
In the following code I am trying to write book information into a .txt file so that I can then read from it later to display all of it. However, I noticed that...
[7 replies] Last: The code is now this, rich1 was correct but he had the ios::app in t... (by ScottJ53)
Help with &&
 
Hi, I was looking at the tutorial of the function template std::make_pair. I don't recognize what the symbol && following the arguements type means. Does it mea...
[5 replies] Last: Indeed. In that case, I was mistaken. (by Ispil)
October 2014 Pages: 1234... 70
  Archived months: [sep2014] [nov2014]

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