Beginners - February 2014 (Page 39)

letter-counting program
 
I'm writing a program that is supposed to count the number of hexadecimal digits (a, b, c, d, e, and f's) in a line of text. The output should look like this: ...
[1 reply] : find() does not count: http://www.cplusplus.com/reference/string/strin... (by keskiverto)
Boolen funcion trouble
 
I have to write a program that tests to see if the correct input is being given during prompts. If non integers or negative numbers are entered it's supposed to...
[2 replies] Last: Hi njrobby, You a few things going on here - the first one is to plea... (by TheIdeasMan)
How to open a file with fstream?
 
So, I am making this database thing for names(it IS a console application), and I have it where says: Hello, do you already have a file? (y/n) And, if y...
[no replies]
Question about the tutorials
 
i just had a quick question about these tutorials. http://www.cplusplus.com/doc/tutorial/ i was just wondering if these are just the beginner tutorials an...
[3 replies] Last: Tutorials on this forums are very helpful and well-written, they are s... (by Uk Marine)
Completely stuck and lost
 
Program is supposed to: 1) Be given the name of a file and open the file for input. If the file cannot be opened, program should immediately print an error m...
[1 reply] : It looks like you're expected to use functions, certainly for step 2; ... (by kbw)
by iluv41
Cannot get file to open?
 
I am trying to get a simple html file to display but I cannot get the file to actually open. I have the file in the same place as my program files but it will n...
[12 replies] Last: I had same problems in past. My mistake was not adding .txt or .xl or ... (by o0reyiz0o)
by gghf
terminating the loop with \n
 
I am making a class that reads a sentence then stores it. The teacher said that the loop should stop by looking for \n Does this mean that the loop should sto...
[1 reply] : "\\n" is "\n" string. If you want to stop look when newline character ... (by MatthewRock)
Family of function pointers
 
The following code is working enum MonsterName {Goblins, Hobgoblins, Ghouls, ...}; template <class MONSTER, typename T = int> std::vector<Monster*> crea...
[1 reply] : I would recommend you looking into Factory pattern, it's probably what... (by MatthewRock)
Need to add info to section of program
 
How do I add information to this section of my program? I need to add last name, month of birth, day of birth, year of birth, etc.... // get first ...
[10 replies] Last: @mikeyboy: Sincerely, you do that a lot. (by closed account iAk3T05o)
g++ compiles but nothing happens when I run
 
I have to write a code that has the cin.fail()==0 check in the body, so that when you try to enter a negative number it replies that can't be done. The g++ does...
[1 reply] : while (done=false){ should probably be while (done==false){ .... (by Peter87)
'operator>>' Error
 
Hai. So, I literally just started C++ yesterday, and I was wondering why this program didn't function. It is a username and password generator. #include <...
[2 replies] Last: Oh! xD That was a silly mistake. I always forget when I'm writing C++ ... (by Uminious)
by fi50
Wait, recursion does what?!
 
Hey. I was just wondering if anyone could explain recursion in a way that even remotely makes sense. I understand the concept of a function calling itself an...
[1 reply] : This thread may help! http://www.cplusplus.com/forum/beginner/123122/ (by eyenrique)
mapped maps in classes
 
I am trying to write a map in a map, but wrapped in a class. I stripped down the code to bare bones: #include <iostream> #include <string> #include <map> #inc...
[2 replies] Last: You probably meant to do this: Dict<std::string, Dict<std::string,st... (by metulburr)
Floating point exception and infinite loop.
 
So for class we are working in Linux and we are supposed to use a class stack that we have created to perform PostFix Evaluations. Afterwards we should print wh...
[1 reply] : Floating point exception is usually an error you get when dividing by ... (by Peter87)
Simple averaging problem
 
Whats up guys, just got a simple averaging program here. I can't seem to figure out how to have the 5 numbers averaged out. I got the for-loop working fine for ...
[2 replies] Last: Are you allowed to use arrays? i.e. //AverageProgram.cpp //## #in... (by eyenrique)
Compiler says a string doesn't name a type when it does
 
This is a .h file for a slightly larger program where the program counts the number of uses of the words in a text file. The compiler keeps telling me that the ...
[2 replies] Last: thanks, that fixed it (by pepstein)
Unresolved external symbol
 
Hey guys, I got some help from you to fix my program. I just finished it but I'm getting a bunch of unresolved external symbol error. Anyone know what's going o...
[3 replies] Last: Your tutor has provided declarations for all those methods in the head... (by MikeyBoy)
Template class
 
Initially, the task was to implement a class that would define the type of the input string variable (int or char), I did it. Now,  need to convert this class ...
[no replies]
Rock paper scissors
 
Hello. I'm making a rock paper scissors game and its causing me some problems. I would appreciate someone explaining to me what went wrong and if I'm over comp...
[5 replies] Last: Thanks everyone. Got the problem figured out. You people rock. (by faust058)
limit input to only integer
 
Hi guys, I'm pretty new to C++ and I've been trying to figure out how to limit user input to only integer. I've found out a way using while loop to get rid of s...
[6 replies] Last: Thank you JLBorgers for the detailed explanation! (by lovex24)
February 2014 Pages: 1... 3738394041... 60
  Archived months: [jan2014] [mar2014]

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