Beginners - February 2012 (Page 40)

Rand problem
 
#include<iostream> using namespace std; int main() { srand(time(0)); char playAgain='y'; int a; cout << "Welcome. You are playing the Classic 'Rock Pa...
[1 reply] : nvm I fixed it. (by Anmol444)
Binary AND
 
I am supposed to write a program that does the following. Define a binary number as: int binNum ; Use binNum to store the most significant (i.e., left...
[5 replies] Last: What I was confused on is the const int* I took that to be an intege... (by monkeybutt)
I need help with this program
 
Why doesn't fullName get the value I assign it(first + last name)??? ----------------------------------------------------------- #include<iostream> #inclu...
[4 replies] Last: i had to use concatenates, and only use c strings.. thanks guys for al... (by cplusdummy)
by atjm88
int or double?
 
Hi, my code below can function with int or double, so may I know any different between them? #include <iostream> #include <conio> int main () { int m...
[2 replies] Last: I not really understand about int, double, word, and long, can u brief... (by atjm88)
Why is it optimal to use inline functions?
 
Apparent, inline functions are defined in the caller's code stream, which improves performance. What does this mean? I wrote an inline function and it behave...
[3 replies] Last: The meaning is a whole bunch of low-level space-time optimizations. ... (by Duthomhas)
by atjm88
Greater and Less Than~
 
Hi, I tried to run the following code, but the output give 2 result when i insert a number (eg:56), may I know how to give only one output for each mark? eg: 56...
[7 replies] Last: else if (mark<50) there is no another possibillity for 'mark' So you... (by ne555)
Little things
 
1) int i=5; or int i(5); ? 2) unsigned char maxc = '\xFF'; or unsigned char maxc = UCHAR_MAX; or unsigned char maxc = std::numeric_limits<unsigne...
[5 replies] Last: > 1) int i=5; or int i(5);? I have no strong preference about this, a... (by JLBorges)
Trouble creating conditional
 
I am just starting to learn C++ using the "C++ for Dummies" book about 3 days ago and I'm on a chapter 3 dealing with conditionals and loops. It uses the Code B...
[1 reply] : if (y == "Betty" || "Sue" || "Jeff" || "Abby") needs to be instead: ... (by Texan40)
Dynamical Char Arrays
 
I had a question concerning the use of dynamic char arrays with the constructor of a class. Here, I have a class in which I pass a name that will be stored in...
[4 replies] Last: Thanks Disch, that worked great. (by thephysicsguru)
double multiplication error
 
I'm not sure if I'm doing something completely wrong or if this is an error in Dev C++ but cents SHOULD cout as 9, but its coming out as 8. double fractPart ...
[2 replies] Last: that fixed it thank you so much I was going mad (by savan12986)
How to compile and execute with Visual Studio C++ 2010 (need detailed steps)
 
Also could you read it and see if i missed anything //Herons Formula #include <cmath> #include <iostream> #include <iomanip> using namespace std; int ...
[3 replies] Last: Thank you very much for your help. Check it out I finally finished it ... (by JCharles)
Help please. Using Triple, cmath, logical/relational operators, increment/decrement, loops
 
Hi I am having trouble with this program I am trying to write. So far I have this: #include <cmath> #include <iostream> #include <iomanip> using namespa...
[no replies]
by istale
Dynamic String Arrays
 
I'm writing a code that can add a name to a list of pre-existing names or remove a name from the same list. Everything works fine except when I try to add a nam...
[2 replies] Last: I can't believe I didn't realize that . . . I've been messing with thi... (by istale)
Trouble executing order correctly
 
I've got an assignment for my C++ class which basically goes like this: Write a program which will accept the names and finish times of 3 racers, and will deter...
[2 replies] Last: Thank you, ill add that in and see how it goes. (by Alan Garcia)
by cokane
Error: expected initializer before '%' token
 
I need a little help figureing out why I am getting an error in line 9. #include <iostream> using namespace std; int devideNumbers (int a, int b){ ...
[8 replies] Last: I am taking my C++ class online, I wish the class was in person so I c... (by cokane)
by jhorie
function() const {};
 
Hello, #include <iostream> using namespace std; class MyClass { mutable int i; int j; public: int geti() const { return i; // ok } ...
[2 replies] Last: Thank you very much. Now I understand:) (by jhorie)
by Isolde
system("pause") in Dev-C++ (1,2)
 
Hello Everyone. This is my first big program. I don't know if the issue is the system("pause") statement or what.The exercise: Write a program that reads a f...
[25 replies] Last: Hi, Thanks for that, now I got it^^ (by atjm88)
Read Characters in 1 row of a 2D Array
 
Hello, im working on an array and need some help with my for loop. My program asks the user for a starting position in the array. The program needs to enter a l...
[no replies]
by Duncan
Why do Floats and Doubles seem the same?
 
I read that doubles should hold about 15 digits, and floats can only hold 7 (http://cplusplus.com/doc/tutorial/variables/). But then why does this code output a...
[2 replies] Last: I see, so it's cout's fault after all. Thanks! (by Duncan)
Confused and lost.....
 
Hi everyone, I am working on an a school asignment, basically create a build in list.(why we cant use the STL do not know..) I am not familiar with templa...
[3 replies] Last: Typo at line 6, leave a space between new and TYPE . size = size +... (by Catfish)
February 2012 Pages: 1... 3839404142... 64
  Archived months: [jan2012] [mar2012]

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