Beginners - January 2013 (Page 8)

by User1
When asking for user input program skips two questions.Information below.
 
#include <cstdlib> #include <iostream> #include <string> #include <sstream> using namespace std; int main() { string airLine = ""; string destination =...
[3 replies] Last: Try running the code through a debugger - or put extra cout statements... (by TheIdeasMan)
Vector of character arrays
 
I have declared a vector by "std::vector<char > token;". I expect this to create an empty vector of tokens, each 20 characters long. When I then add an it...
[4 replies] Last: Thanks to both of you for getting me thinking. I have now found that ... (by Jeff Whittle)
by rcast
Visual C++
 
I have a student account with Dreamspark, microsofts software subscription service. I can access a free version of Microsoft Visual C++ Studio. I'm trying to le...
[2 replies] Last: with Visual C++ you can also select a blank project. Then it wont be s... (by Oria)
by G677
Trying to write a simple "Battle Script"
 
I'm super new to c++ obviously. I decided to take on a challenge and see if I could use my limited knowledge of variables and functions to make a simple battle ...
[5 replies] Last: For rand to work, you need to use srand in Main to create a seed; #i... (by Oria)
by Mead
Too few arguments error
 
Hi, I would like someone to please tell me how to fix this problem. I believe it's expecting more arguments than one? This is a program for calculating binomi...
[2 replies] Last: !! Thank you. Wow, I can't believe I overlooked it. I'm using Sourcel... (by Mead)
Check writing program
 
Hello I am writing a check writing program. I have most of the program but I cant quite figure out the function to change the numbers to words. I have the pseud...
[5 replies] Last: All you can do is practice. Programming in general is pretty simple if... (by PatricBernard)
Insertion into 2d array
 
I want to create a program to insert an element into a 2d array. User will wnter the array then element to be inserted its both row and column position. We hav...
[1 reply] : You already failed the first part of the assignment "size of array is ... (by LB)
C++ overloading question
 
Hi, I just wanna ask about this particular part of a code inside an overloading operator function. template<typename TYPE> BOOL bFile::operator >> ( std::vec...
[6 replies] Last: Ah, I see! I didn't actually read the function contents. (by Stewbond)
String array into double array
 
Hey so couldnt find a way to read in a text file to a double array. So I read it in using getline, into a string array. Now I want to convert the string array i...
[6 replies] Last: Use stringstream? std::fstream iFile; iFile.open( "myTextFile.txt"... (by Lynx876)
by vrakas
Bool array
 
Are bool arays by default false? i mean if i declare a bool arr ; does it have n false entries by default?
[6 replies] Last: hm, ok, thanks! (by Fransje)
Blackjack random numbers
 
I am a beginer and I want to have a code with a random number generator, but my code does not follow what I would like it to follow.... PLEASE HELP! . This is w...
[8 replies] Last: Ok this is actually quite simple to do. What you need to do is declare... (by closed account 3qX21hU5)
Runtime Error #3 (reapeating numbers code)
 
It gives me this error which does not allow me to run my program. Also my program will keep repeating it's code.... what do I do? Please help i need to finish t...
[6 replies] Last: Why do we have 3 threads about the same thing? Don't do that - it's an... (by TheIdeasMan)
How to make a choose your own path game... (1,2)
 
I want to know how to make a choose your own path game. I am relatively new to c++. HTML got boring so I am here now. I want to know how to make it so you can p...
[28 replies] Last: Thanks for everything guys! (and girls if there are any)... I have use... (by Willmannn)
Do-While loop help!
 
Okay. That seems to be working, but my do-while loop keeps repeating itself when called on. Here's my code... can you see what's wrong? #include <iostream>; ...
[5 replies] Last: Thanks Guys!!! My problem has been fixed, but now I face the problem o... (by SoulHero)
I'm having a hard time understanding this.
 
Hi, I'm a beginner in C++ and I'm having a hard time understand this code from the tutorial: // factorial calculator #include <iostream> using namespace...
[4 replies] Last: @Program Programmer Did I mention I DONT GET ENGLISH SO WELL? I th... (by vlad from moscow)
Having problems with random numbers
 
Hey I'm working on an exercise where the program creates five different sets of lottery numbers. Each set of numbers are supposed to contain unique numbers. I a...
[6 replies] Last: I'm glad I helped ;) (by bandicoot360)
My program cant read gets()
 
For example char text printf("Enter some text: \n\n"); gets(text); It works perfectly fine , but when i copied the code to a new task, full ...
[11 replies] Last: fgets() is the same as gets() in this case, but a bit safer, as it avo... (by Chervil)
by Ch1156
Dinosaur Arena game help
 
I have been working on my actual game now and I am having a real problem, i cant use dinosaurHealth in my main function. MainGame.h #ifndef MAINGAME_H_...
[7 replies] Last: Thanks for the reply and the feedback, i fixed the problem almost righ... (by Ch1156)
why do we say "using namespace std;"
 
In all of the programs I've written for practice and school I've had to say #include <iostream> using namespace std; I know the reason why I always ...
[4 replies] Last: the purpose of a namespace is to avoid name clash using namespace st... (by coder777)
Output is nt showing even though the file is open
 
#include <iostream> #include <iomanip> #include <fstream> #include <string> #include <math.h> using namespace std; //Mean calculation double avg (dou...
[1 reply] : Please use code tags. EDIT : You are pening your file several times i... (by MiiNiPaa)
January 2013 Pages: 1... 678910... 52
  Archived months: [dec2012] [feb2013]

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