Beginners - March 2013 (Page 60)

If-else problem
 
Hey everybody. I'm writing a code to print a basic tree, with random birds (v) and flowers (o) in it. To randomise this, I'm using a randomly generated number a...
[2 replies] Last: That solved my problem, thanks! :) (by Darkkillex)
by Dirk23
read file
 
I want to read a file, but this code works only for the first line. What should I do if I want it too work for the second and third and .. line also? char* rea...
[1 reply] : You should look at this example http://www.cplusplus.com/reference/cst... (by mariostg)
Hangman issue
 
Hi everyone, I am nearly finished writing a good version of hangman, the issue that I am having is that if the user enters a correct letter twice, it messing...
[1 reply] : I solved my own issue, i decided to save guessed letters into a new st... (by nukeboy666)
please check mine :)
 
question: write your implementation of the function double power(double x,int y); that returns the value X^y for int y. make sure that your function works corr...
[5 replies] Last: oh..... thank u very much for ur help! i need to push much effort to ... (by ain najwa)
floating to hexadecimal - writing function
 
Hello geeks. My teacher gave me horrible homework i can't cope with. He told me to suggest a way to convert floating numbers given in decimal system(ex. 123.45...
[1 reply] : http://en.wikipedia.org/wiki/Positional_notation#Base_conversion Shoul... (by MiiNiPaa)
Trouble understanding break and scope of for loop.
 
After managing to complete problem 7 of the Euler's project (finding the 10001st prime number), I looked in the forums to find a quicker solution that doesn't u...
[2 replies] Last: Thanks a lot Chervil, that cleared things up nicely. Appreciate the ad... (by Olysold)
structs and functions
 
hello there, I'm working on a program for my class I'm using struct and functions well here is my problem I made a function that reads from a txt file and that ...
[5 replies] Last: thank you very much edit: changed it to void, still works fine (by eblader)
How to use tab(/t) with Format
 
Hey, I am working on some code where I need to print out some strings but will like to tab after printing each string. I know you can use the tab escape key wit...
[3 replies] Last: That should work. You don't have to put each string in double quotes,... (by binarybob350)
reading a line of unsigned integers with spaces
 
I want to read a line of unsigned integers from a file seperated by spaces and put the values into a vector
[9 replies] Last: Not the same, but similar in one-two thing: http://www.cplusplus.com/f... (by fx11)
string not added to list
 
#include <string> #include <sstream> #include <iostream> #include <list> using namespace std; int main () { int test = {0, 1, 2, 3, 4}; lis...
[2 replies] Last: The problem is in your while loop. tempString is the first element, w... (by binarybob350)
by abzksm
need some help please
 
I input X,Y and x^y where x=x*x*...x (y times) so how i can find power in C++?
[1 reply] : If y is of type int and y > 0 you can try: long power = 1; for (int... (by abhishekm71)
create X objects
 
How can I create x objects of a class if x is an inputed int? class test{ }; int x; cout<<"Enter obj. numbers to create:"; cin>>x; // create x obje...
[9 replies] Last: Dynamic allocation (new/delete) can get very complicated very quickly.... (by Stewbond)
CALCULATNG
 
How to calculate the commission of a person problem. calculates and display each sales person's commission, which is 10% of his or her sales. it should displa...
[3 replies] Last: float sales, commision; cout << "Enter sales: "; cin >> sales; commis... (by Stewbond)
by Dorim
Game list_Immediate Help
 
I'm trying to add a loop which checks if there is any duplicate names. I can't come up wit an answer. I know the concept, but I can't apply it. Would you help m...
[1 reply] : First off please use codetag whenever you post your code to the forums... (by closed account 3qX21hU5)
need some definitive comments please
 
hey everyone, im a beginner in c++. our professor gave a program and our assignment is to make an algorithm for this program. comments must also be inserted to ...
[1 reply] : You want to know what this program is doing. Is that your question? I... (by Chris Meyer)
by Fyah
How can I create a DO WHILE LOOP MENU in C++?
 
OMG
[2 replies] Last: #include <iostream> using namespace std; void printMenu(); void ente... (by tntxtnt)
Trying not to write two FOR loops
 
So this array has a set of values already assign to it. Is there a way to print out the array that was assigned to it and also add them all together in one F...
[6 replies] Last: - Don't worry about it, just programming and having fun. (by thejman250)
assignment, must use qsort in member function. help.
 
The help I need isn't with using qsort, so much as it's using the compare function. I've done it with if else statements, with compare from string class, every...
[no replies]
COMPILING ERRORS
 
Tried doing some research on my own but I just keep changing the error codes. int main () { string time1; // first time entry string time2; // se...
[8 replies] Last: No that is great info thanks for taking some time to clear all this up... (by closed account 91AfSL3A)
Pointer help
 
I am a C++ student and am needing some assistance with the following assignment to where I am to implement a class Person with two fields name and age and a cla...
[6 replies] Last: Thanks too vin, much appreciated (by bigyankeefan)
March 2013 Pages: 1... 5859606162... 87
  Archived months: [feb2013] [apr2013]

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