Beginners - April 2015 (Page 5)

Passing objects into class constructors
 
Hi All, I am working on a problem where I am meant to create a Point class, and then use these objects to pass into a Shape class hierarchy. I am comfortable ...
[8 replies] Last: That last syntax is correct. If you had searched the web with the erro... (by keskiverto)
OutPuting an array with random Numbers
 
i can't seem to output the array wit the random numbers to a file like notepad for example, and i can't figure out why. #include<iostream> #include<fstream>...
[4 replies] Last: Unnecessary repetition. Think about this: int input( string text ) { ... (by keskiverto)
Function won't print what is wrong with it?
 
I'm trying to multiply a 2d array by itself until the specified location is no longer zero but for some reason it will not print on the console. Why is this ha...
[2 replies] Last: I figured it out. was an infinte loop. prog doesn't work though. (by jackelinblack)
c++ vector bubble sort
 
Write your question here. I have written bubble sort function for a vector passed in by reference in two different ways, but they do not work. What is wrong wi...
[2 replies] Last: The first one is almost right, it will work if you change: while (s... (by Semoirethe)
What could be wrong here? Multiple Inheritance
 
I wrote the following classes, but there is syntax errors there, but I cannot figure out why. class cd_c { public: static physics_c phy;//physics_c is a def...
[8 replies] Last: Thanks, but this doesn't answer my question. (by northfly)
Getting wrong answers from program.
 
So my assignment is to write a complete program that prompts the user to input the radius of a circle(in main function),and calculates the diameter,circumferenc...
[5 replies] Last: no worries dude, happy coding. (by mutexe)
by HeicPy
codeblock ERROR help
 
im totaly new guy, and i have no idea why i cant build anything, tried 3version of codeblock and still getting this same: Compiling: C:\Users\Riki\Desktop\...
[no replies]
by SeNNa
Problem with conditions in an ATM queue sim
 
I coded this ATM queue simulator for my ADS class's project. What is needed is the following: The program should ask the user to enter Opening t, Closing t,...
[no replies]
by relgin
How to read data from file
 
I need to write a program that reads the thrust data for a model rocket engine from a file and prints the data to the screen.The first line is information about...
[11 replies] Last: If you are wanting to pass the entire array at once to the function, t... (by Tom56785)
Change array values
 
How can i change a specific value in an array, if there is already a value at that location? After printing the array again, no values are changed. int c...
[1 reply] : If I understood correctly you can change the specific value by using i... (by MRQ1)
Data Structures questions
 
Hello. I need help with two programs. list<Bunny>mylist; //I'm not sure if this is right. list<Bunny>::iterator it; //And I...
[1 reply] : I discovered I don't need iterator for the first loop (of the first pr... (by mighty asker)
by Audy45
Two-dimensional array C++
 
Hello i need help in answer ,, what is output? #include <iostream> using namespace std; void main() { int a ={{1,2},{3,4},{5,7}} for(int i=2;i>=0;i++) f...
[1 reply] : Try stepping through the code yourself using a pencil/paper. Either th... (by firedraco)
by MRQ1
OOP application and win32 API programming.
 
Hello everyone ! . I needed help with two things. Any resources that teach the application of OOP in large projects. The second thing is that I want to learn wi...
[no replies]
Clear console and "press any key to continue" functions
 
Hi everybody, I'm trying to write a little program with some switch statements. I wanted to make a clean and neat menu interface (yeah I know, useless..) by cle...
[1 reply] : #include<iostream> int main() { char op; swith (op) { case 1... (by MRQ1)
Fibonacci using Recursion
 
Make a program that will determine the fibonacci at the desired position number using recursion. Example: Enter the first Fibonacci number: 12 Enter the sec...
[5 replies] Last: A function is recursive if it calls itself. This is how the recursion... (by fg109)
Random int generator being weird
 
I have a function that generates random integers and the first integer that it generates is always really small compared to the rest, and I don't understand why...
[2 replies] Last: That did the trick! Thanks!! (by INeedAHero)
by HG319
How many calls necessary for quickSort
 
I was given this question and was hoping someone can let me know if my answer is correct. How many recursive calls are necessary when quickSort sorts an arra...
[6 replies] Last: Just did a quick google search on what "median of three" actually mean... (by fg109)
by enemy
friend classes_ why constructor shouldnot be private?
 
Hello! Please, classes A and B are friends! Please, where is the mistake, why is another class not seing elements from class b, if it is its friend? A should ...
[12 replies] Last: :'DD You're welcome ;) (by Gamer2015)
Read a file and get specific characters from a string using C++
 
I have two files, fileA and fileB. I want to get the 3rd to 13th digit from fileA and should be checked against all ranges in fileB. fileA: 5000000123450...
[1 reply] : To read from a second file, all you need to do is create another ifstr... (by BlatantlyX)
Looking to overload put operator (<<) recursively
 
I've been having trouble on how to overload put operator (<<) recursively. I know it's easier that it's supposed to be, but I am still fairly new to recursive t...
[3 replies] Last: Try a static variable: ostream& operator<<(ostream& output, Recursio... (by coder777)
April 2015 Pages: 1... 34567... 52
  Archived months: [mar2015] [may2015]

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