General C++ Programming - March 2014 (Page 31)

by Dkob1
Need help with an equation
 
How do I get an output like this using cin.peek? Please enter an expression (like `4 * 5` or `ln 5`): 4 * 5 4 * 5 = 20 Please enter an expression (like `4 *...
[no replies]
by Dkob1
Error in my program
 
I keep getting an error for undeclared choice and cin, I don't understand what to do? #include <iostream> using std::cout; using std::endl; int main(...
[6 replies] Last: ok thanks (by Dkob1)
Symbolic names basic doubt
 
Hello, I'm learning how to use c++ because I have to work with a code written with it and there's a part of the main.cpp I don't understand. I've looked for it ...
[2 replies] Last: So I don't have to pay much attention to this in order to understand h... (by ryllprous)
Replacing String in Hangman Game
 
Hi, I'm making a hangman game. All i need to do is after the user guesses the letter correctly it replaces the stars with that letter. I have been trying for t...
[2 replies] Last: I changed the part that i need help with (by shayanaijaz)
Problem with User defined functions!
 
I have a problem converting some of my codes to a function like the adding a value at a queue. this is my original code and it is working fine. And please tell...
[6 replies] Last: Haha! Now I have a bit of understanding of what it is all about. All m... (by Skhiburdhurs)
Question About The First Argument In Main()
 
Does anybody know why the first parameter to "main()" is a signed integer instead of an unsigned or even a short? Is this a left over consideration put in for b...
[3 replies] Last: It's not convention, it's for backwards compatibility. Back before C h... (by LB)
Can main() be called recursively?
 
Can main() be called recursively?
[6 replies] Last: i dont think there is ever a good reason to call main You're right, ... (by MikeyBoy)
Consistent random numbers across implementations
 
If I seed with the same seed I want the same sequence of numbers no matter if I use GCC, Clang, VC++ or Windows, Linux, Mac. I think this is guaranteed by the s...
[3 replies] Last: Ok. Thanks you for confirming my thoughts. Much appreciated. (by Peter87)
by y12321
problem with reading a string and comparing
 
Hi! I'm trying to read a string and then compare it to a word. My code: char* cmd = "start"; std::cin >> cmd; if (strcmp (cmd, "eval")) eval (); ...
[4 replies] Last: Well, you do not need strcmp with std::string, you can compare directl... (by MiiNiPaa)
by Chubby
Data Struc
 
This is this part I have question: Why it didnt calculate the area? What did i wrong? here is output Welcome What is the upper left coordinate do you like to...
[2 replies] Last: You didn't show us any code that handles the inputting of the x and y ... (by doug4)
using GUI
 
Am writing a spreadsheet program but I cannot draw line using codeblock. Please I need help.
[4 replies] Last: I do appreciate. Thanks (by quadrangle)
****Help in operator overloading in classes! *****
 
SOLVED // overloading operators example #include <iostream> using namespace std; class CVector { public: int x,y; CVector () {}; CVec...
[15 replies] Last: @JLBorges it did add that section: http://en.cppreference.com/book , b... (by Cubbi)
C++ exercise with virtual functions
 
My main function is this: int main(int argc, char* argv ) { int l1, n; Ball** ball; l1=atoi(argv ); n=atoi (argv ); for(int i=0; i<n; i++) ...
[3 replies] Last: MikeyBoy 1) I'm new in the forum....I will certainly apply what you ... (by nikos91able)
Free Code Browser for C++
 
Hi, I have source code C and C++ of more than 800MB size. I am facing lot of problem in browsing the code. Please suggest me any of the good reverser engin...
[no replies]
by xpg94
What to learn next?
 
I've been learning c++ for about a year now. I went through tutorials on this website and on learncpp dot com. I've done lots of exercises (the most important o...
[8 replies] Last: I would definitely start learning some GUI programming. That seems lik... (by knn9)
string words into aray
 
say i have a string called "org_string" org_string = "REFRACTIVE LIGHT"; i also have a string array called keys ; keys has 6 elements(obviously) and right ...
[4 replies] Last: You can use getline. Google "c++ getline delimiter". (by iQChange)
Function not storing data in array.
 
Following function is from a bank account, when new account is created it won't store it in the array or i guess it does but find_acct function wont be able to ...
[2 replies] Last: Is acctnum_array and balance_array large enough to hold num_accts? C-s... (by jmadsen)
Factory pattern
 
can you explain me what means this architecture and how i can instanciate my object : classe A { friend class B; friend class C; virtual int function1()=0; v...
[2 replies] Last: but i need to use A functions, and B,C functions too. A *a ; B b =... (by lhoussain)
Data Member Refrence Problem
 
I have created this program with the class Rectangle, and i have gotten most of the errors out I think. However, I am getting these errors, which I do not know ...
[2 replies] Last: The duplicate symbols is because a static member variable needs to be ... (by jmadsen)
Creating a Random Number Generator
 
Hey guys quick question here, How would I go about creating a random number generator (or pseduorandom I suppose) with user inputted lower and upper bounds a...
[3 replies] Last: Well you are going to have to create a formula then here is something ... (by giblit)
March 2014 Pages: 1... 2930313233... 36
  Archived months: [feb2014] [apr2014]

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