Beginners - January 2012 (Page 5)

Program that will output correct sentence stucture
 
Hello, I need this code to correctly out put a malformed sentence removing spaces and is terminated by a period. Example: this is a TEST . ...
[10 replies] Last: Alright thanks Kapo! (by closed account 9L8T0pDG)
trying to get script to repeat
 
I have this script #include <iostream> #include <string> using namespace std; string start; int main() { while (start == "s") false; ...
[2 replies] Last: I have this script Yea, no you don't. C++ is not a scripting languag... (by ResidentBiscuit)
by JetX9
Wanting to compare multiple variables of the same type.
 
Okay. Right now I am writing this program from scratch that is supposed to do basic collision detection for class. I have run into a problem that, as is, wil...
[5 replies] Last: I think I may have found an alternative using the Conditional Operator... (by JetX9)
Problem with output
 
HI I have a small program with 3 files. main.cpp #include "head.h" #include <iostream> #include <string> using namespace std; int main() { loop: s...
[7 replies] Last: [quote=Lynx876]On another note, what happened to you yesterday, Framew... (by Wazzak)
Error: Invalid conversion from 'Int' to '*Card'. Help please!
 
Hey peeps, basically I'm trying to create a program that creates a deck, shuffles it, and deals hands. I have created the deck. Now I am trying to create an arr...
[6 replies] Last: hand is an array of Card s, not int s. The type on the left-hand s... (by Wazzak)
std::flush, what's it good for?
 
Why use flush? What does it exactly do, and also is it bad to use a lot of std::endl's through-out one's coding? std::cout<<("See")<<std::endl<<std::flush; ...
[4 replies] Last: oops just re-read what you said, never mind my question (by iBLooDiESiN)
Problem with if and if else statements
 
Hello there! I have a program that simulates a battle. It has one major problem though. When the user dies, the program outputs that the fight was a tie. If the...
[1 reply] : line 206 ps: why did you add line 217 ? that will make it always be a ... (by kapo)
by ihato
Making a Command Prompt command.
 
I know some basic stuff in C++ but what I don't get it is how to create a program for command prompt. All I know is that main has to has these arguments: in...
[6 replies] Last: If your program is named com and you run it as com -a == com /a == c... (by Peter87)
by JetX9
Problem sorting an Array.
 
I'm sorry to say...I am completely lost. It's been a whole semester since the last time I picked up C++, and now I cam completely clueless on what to do here. ...
[10 replies] Last: You will be 'adding' the headers, but you should know. It's quite har... (by ne555)
Spaces with string?
 
I'm having a bit of trouble getting spaces to work with string. The program works perfectly if the "lotName" is only one single string with no spaces, but ends...
[2 replies] Last: ii thing he's already using using namespace std; so take out the "... (by kapo)
issue with loops
 
HI I have a small program with 3 files. main.cpp #include "head.h" #include <iostream> #include <string> using namespace std; int main() { loop: s...
[3 replies] Last: Thanks more great answers from you guys welldone (by markkirby)
Displaying an Error Message
 
I'm trying to prompt an error message stating that when the user puts nothing into "lotName," it will spit out an error message. The error messages are stored a...
[7 replies] Last: thank you! I did not know it was something as easy as that. Much appr... (by RawrDuy)
Recursive program to find vowels
 
This program uses recursion to find the number vowels in a string. Can someone please explain to me what the purpose of "subscript" is in the program. The pro...
[2 replies] Last: thank you. (by DocCeaser)
How to pre-declarate a class like we do with functions?
 
We can pre-declarate functions like void funtion (int a); //...code... void funtion (int a){...} How do we do the same for classes? Or its not possible? ...
[13 replies] Last: I've yet to see "the only solution for X" in C++. But IMO this would b... (by Computergeek01)
by pxm76
ios::width vs.< iomanip> setw()
 
I wanted to know if when formatting output if there is a preference between iso::width from the <iostream> header and setw() in the <iomanip> header? If there i...
[2 replies] Last: That makes sense. Thanks for the reply! (by pxm76)
Subsequent call to cin.get() does not work.
 
I wrote this as a very, very small test of how istream's member functions work: #include <iostream> using namespace std; void main() { char me; ...
[4 replies] Last: Oh, \n is the delimiter. That makes sense. Thank you, everyone, for t... (by Trianos)
Cannot get my getters to work!?
 
Here is my code, not working =( FILE: main.cpp: #include "cscd305_w12_lab3.h" int main() { CArray integers1(7); // seven-element CArray CArray in...
[4 replies] Last: Thanks that CArray::getSize was what i needed most also decided to us... (by joshhazel)
syntax problem
 
Hi This is my syntax #include <iostream> #include <string> using namespace std; int main() { string name; int x = 1; if (x == 2) cout << "...
[2 replies] Last: Yes thats exactly what I need Thank You Moschops (by markkirby)
simple console halt
 
Hey guys, i've been using system("PAUSE") to halt the console and to see my output. But i've heard that it should not be used, so can anybody please tell me any...
[12 replies] Last: Don't like the GCC layout. So I dont work with it. GCC doesn't hav... (by Moschops)
More Rand Issues
 
Hello all, I recently posted a thread concerning issues with using rand in programs. I am still having some trouble as I now have to change the program again...
[4 replies] Last: Well, that whole bit in the parentheses could be brought to just one n... (by ResidentBiscuit)
January 2012 Pages: 1... 34567... 48
  Archived months: [dec2011] [feb2012]

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