Beginners - May 2016 (Page 2)

help with deep copying a binary tree?
 
hello i am trying to write a function that would make a deep copy of a binary tree. #ifndef Binary_Trees #define Binary_Trees # include <string> #include <fun...
[2 replies] Last: yea trying to copy the tree to a empty tree (by soccerfan12)
Spitting out fizzbuzz to a txt file?
 
Quick question guys, I'm trying to make my whole fizzbuzz information print to a txt file. How would I go about implementing this? My current way I have it co...
[1 reply] : Such a easy solution, just needed to think outside the box. #includ... (by C0D3FR3AK)
Conversion Calculator
 
I am supposed to be creating a program that converts roman numbers to its decimal values. I have done something, but the math is wrong. When entering MCMLXXVIII...
[4 replies] Last: @C0D3FR3AK Your idea works, but the math ends up being wrong and tha... (by ProgrammerXYZ)
by Irhcsa
Problem with code blocks
 
Disregard. Solved my issue.
[no replies]
getline??
 
#include<iostream.h> #include<conio.h> #include<fstream.h> void main() { clrscr(); int age; char name ,c ,gen ; ofstream yo("Yo.txt"); cout<<"Enter nam...
[1 reply] : The problem is that you are using getline after a >> operator. The >> ... (by Kurisutofaa)
Weird Rand() problem
 
This is a coin toss program. Every time I run the program it will give either all heads or all tails. It's never a mixture of both. Is it only seeding the gener...
[3 replies] Last: Well, i guess it does. Thanks haha (by GigaMuff)
by crepe6
Return string using function.
 
Hi i'm stuck on this question. // create a function that inputs a seed and used the function below create_permutation to generate a pairing of the alphabet and...
[4 replies] Last: for example string a = "ABCD" i want to return a pairing of the strin... (by crepe6)
How to read a key in c++? I learned it in turbo pascal how to translate in c++?
 
How to translate this code from turbo pascal to c++? writeln('Would you like to exit? es or o?'); choice:=readkey; if (choice='N') or (choice='n') then ...
[2 replies] Last: But remember that getch() is not standard, therefore it may not be ava... (by jlb)
fstream not creating file
 
anybody have any idea why a file is not being created called haha.txt when I run this code?? am I missing something? I'm running codeblocks #include ...
[2 replies] Last: Because you're trying to read from the file. Reading from a file doesn... (by Moschops)
by Irhcsa
Typing
 
What is the proper line of code to make my program type in an address bar or just type in general? Like I use this to make my mouse click: mouse_even...
[1 reply] : I found something that does what I want but It seems overly complicate... (by Irhcsa)
Saving and loading a level
 
Hi. I've been writing a text adventure game that's based in a dungeon. I've managed to do most of what I've wanted to do, but I've come across one problem that ...
[2 replies] Last: I'm having problems trying to add a save and load mechanic to the code... (by Twifanatic)
by Ruzgar
for to while and if to switch conversion
 
Hello C++ forum users! Im here with another question for you, yet again! Recently I have had a problem with converting for loops to while loops and if function...
[1 reply] : Change line one to : while( i < N ) For the switch add this be... (by koothkeeper)
by looky
foo char [20];
 
Hi there I am trying to follow the tutorial for char arrays however when I type foo char ; foo (no holding boxes beneath) I don't get the square ...
[5 replies] Last: Build a complete C++ program. What you're looking at on that page isn'... (by Moschops)
De-allocation of a pointer does not work properly
 
Dear all, I am learning about pointers in C++. I practice creating a pointer then delete it when I do not need. I use "delete pointer". However the following c...
[1 reply] : ptr=new int; if (ptr==NULL){ cout<<"Memory allocation... (by Yanson)
Roman numeral calculator
 
I need to make a program that converts Roman numerals to its decimal numbers. I need to include a function that yields the numeric value of each of the letters,...
[no replies]
WRITING AN APPLICATION
 
STL containers store data temporarily in that when the program terminates all data is lost. So, what program(s) do you use to store the data in a file and gene...
[4 replies] Last: Say, I had a class that have data members that are a string, character... (by phztfte1)
How to add descending order when sorting strings? I already have an ascending one.
 
What i want is when the user presses D then the strings he/she inputted would be sorted descendingly like what i did with the ascending part and it works just f...
[no replies]
Exception Help Please
 
I have my exception screwed up somehow. I am very new to this and can really use a little help. I just need the one exception to work using the "try" statement....
[no replies]
How does one access value of variables from one class in another class using friendship?
 
I want to be able to use the value of the x and y variable I type in from the Regner class in the extra class. I so far have the following but it's not working ...
[2 replies] Last: So what would I have to do? I want z to have the value of x and w to h... (by rojan1918)
How to let the user choose between ascending and descending order?
 
This program prompts the user to input the number of data then the user types the data then the program sorts it alphabetically in ascending order. How to let t...
[no replies]
May 2016 Pages: 1234... 36
  Archived months: [apr2016] [jun2016]

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