Beginners - November 2013 (Page 28)

by gghf
Why doesn't this loop work like it should?
 
Basically I know how to put my strings and change them into chars for a program I am writing, but when I try to make a loop that does the same thing, the loop c...
[9 replies] Last: Do you mean: std::vector<const std::string> MAD; std::string f; if (... (by keskiverto)
Text adventure
 
I'm almost done with my "Text Adventure" game, but the last thing I need to worry about is getting my game to end once I hit the exit door. I tried break but th...
[3 replies] Last: Post all of your code again in the code tags to make it easier to read... (by cspctec)
by Xesna
Celsius Temperature Table not working?
 
The question that keeps arising time and time again is the following, "Why is the code not properly displaying the accurate results?" I have searched similar ...
[2 replies] Last: Thanks. Also, I apologize for not adding #include <iomanip> , forgot ... (by Xesna)
program crashes
 
I can not figure out why this code is compiling but crashing. Any help would be awesome! I am trying to make a full deck of cards and put each card into a struc...
[5 replies] Last: Thanks so much for your help on this moving the counter variables to t... (by bpedigo)
Parsing a string to get numbers
 
I have the following string: string test = "20400\nJohn"; And I need only the number 20400. I have been trying to do this for the past hour but I ...
[3 replies] Last: Thanks... I changed the "\n" to '\n' and now it works. (by cspctec)
by Mayah
Simple program using functions
 
Hi! I have written a fully functioning program that prompts user to type in values, stores them in an array, outputs array in ascending order and then output...
[1 reply] : Assuming that you mean "square root" from the function "SqRoot", you c... (by cspctec)
Else If problem
 
At a certain point the else does not see the if and thinks that it requires an if. Does anyone know what I can do? //Employee Payment Calculator #inc...
[2 replies] Last: Thank you so much! (by JoonStudios)
by Cayle
Help with classes not being able to call functions.
 
Hi, So I wrote a simple program and tried to call a function from a class outside of the main file. When the class is in the main file the program runs fine. Ca...
[4 replies] Last: All of my files are .cpp/.hpp the second error went away as you said. ... (by Cayle)
Contact List/Address Book program
 
Help no longer needed
[2 replies] Last: Thanks for the reply. Unfortunately, we haven't gone over std::map muc... (by johngreen04)
Initializing Variables in Derived Classes
 
Hi, I have my main class with multiple variables and a constructor. Then I derived other classes that use the same variables from the base class and I want to i...
[3 replies] Last: ohhh thank you!!! (by sakonpure6)
by Al GIS
Multiple functions with case selector.
 
Hello, this is my most difficult assignment yet. Quick Disclaimer: I am a student taking intro to programming. I have some experience in Python because that's w...
[5 replies] Last: As I suspected I should have followed the pseudocode in the order list... (by Al GIS)
by RabMac
Issue with strings
 
Hi, I am currently trying to make my output display but I can't get it working I would like it to display like this: *********** *--------------*//ign...
[4 replies] Last: Thanks very much for all the help mate, really appreciate it. (by RabMac)
Complex Numbers
 
Is there any way I can reassign a complex valued variable a completely new value without creating a new complex variable. complex<double> A(1,1); //I k...
[1 reply] : A = std::complex<double>(2.0,2.0); should work, according to: http:/... (by closed account D80DSL3A)
Replacing strings in a dynamic array
 
For my assignment I am required to replace certain words and phrases with other strings. I have looked at the <algorithm> library which I have trouble implicati...
[4 replies] Last: try this: create a function to replace a word. string replace_with(... (by IWishIKnew)
Help! I get an 'Invalid null pointer' error
 
I've been trying to figure out what the invalid null pointer may be but I don't see to figure it out. Can someone help me out, maybe you can catch it? #inc...
[5 replies] Last: The problem was in line 29, where I was initializing the struct array... (by Bianelis Liriano)
Using While Loops With Arrays and Classes
 
Its asking me to write the code using a while loop to read in values to an array. void Read() { string id; float price; float ...
[1 reply] : and where is the array? (by Chriscpp)
Reading in .dat file, line by line, and storing in int array
 
I have a .dat file with numbers on each line. For example... 345 66478 43 60263 5212 8943346 ...etc I want to read in each line, one by one, and store each li...
[7 replies] Last: Thanks! You really helped a lot. (by blackvelvet77)
Changing from variable to another
 
I am having some trouble, I am trying to change a nominal value to a new value.. I declared the nominal value but later I want to prompt the user to input a new...
[2 replies] Last: I understand that and I haven't got the main I was just trying to fi... (by stardust2552)
by Jon44
Help with creating an updating screen for a simple game.
 
Hey guys. Obviously I'm knew to c++ and programming in general for that matter. I decided to take on a personal project of my own. I want to create a simple, ye...
[no replies]
Find longest words int txt
 
Hello I have those 2 txt files: Two things are infinite: the universe and human stupidity; and I'm not sure about the universe - Albert Einstein Only two th...
[4 replies] Last: Load the two files into two deque<string> objects. Sort them by leng... (by Duthomhas)
November 2013 Pages: 1... 2627282930... 80
  Archived months: [oct2013] [dec2013]

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