Beginners - February 2010 (Page 18)

toupper not working
 
// Get firstname/lastname std::string firstname; std::string lastname; std::cout<<"Enter First Name? "; std::cin>>firstname; s...
[9 replies] Last: That firstname = toupper(firstname ); worked perfectly. First off ... (by businessman332211)
by Botyto
multiple definition of
 
Hi, I'm trying to make myself a file where I declare all my functions, but it isn't going well. On my first function I get an error: Multiple markers at this ...
[10 replies] Last: srand initializes the random number seed and is needed for rand(the ra... (by BettyBoopTS)
by enrui
While loop not working as expected.
 
unsigned char response = 0; while ((response != 1) || (response != 2) || (response !=3)) { //validation check and enter new response cin >> response;...
[2 replies] Last: I still get the recurrence if I enter a letter instead. Which means s... (by enrui)
by neok
Inheritance, struggeling with making my program more elegant
 
Hi, I'm making a code that prints out business cards for employees and managers. the header files looks like this: #ifndef EMPLOYEE_HH #define EMPLOYEE_H...
[2 replies] Last: Tnx jsmith. My code compiles and does the thing I want. I also thou... (by neok)
why does this happen?
 
when i enter this code: #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <sstream> #include <vector> using nam...
[9 replies] Last: edit: i just tried it, it works. wow i didn't know this, im soooo noob (by jinjin12)
by enrui
Getting data through a class to a function.
 
This is a C++ problem and I'm using Juan Soulle's tutorials as a base. I'm not sure if this is a beginner question but I count myself as a beginner having o...
[2 replies] Last: Perfect. Now I just have to get the returnName() working again. (by enrui)
string class functions
 
I have used these before successfully, however I'm trying to understand them better: in the example of find http://www.cplusplus.com/reference/string/string/fin...
[3 replies] Last: The data structure is essentially a variation of the "matrix class" th... (by Duthomhas)
Random generator not working
 
srand((unsigned)time(0)); int random_crime; int lowest=1, highest=3; int range=(highest-lowest)+1; random_crime = lowest+int(range*ra...
[5 replies] Last: int randomGen(int numOutOf) { return (1+ rand() % numOutOf); ... (by gcampton)
I don't know what I'm doing wrong?
 
Hello, Could you please tell me what I'm doing wrong with this. I have multiple errors, specifically an error that says I need a semicolon in Rational.h in fri...
[2 replies] Last: really...I changed the order than what was in the book because I thoug... (by foobarbaz)
console or project
 
Hi, Whats the difference between win32 console application and win32 project when you select new project and go through the menu's. thanks in advance,
[3 replies] Last: choose blank project, the others are shit templates. (by gcampton)
by w0ot
Multidimensional Arrays
 
Hi all, Im new in Multidimensional Arrays. Would appreciate if anyone could help me do the codes to print out 10 employees, having total salary and bonus more t...
[2 replies] Last: http://cplusplus.com/forum/articles/7459/ (by Mythios)
Inheritance
 
Hi hackers, What is meant by naming a function virtual, I read it means that the function is dynamically binded. Could you tell me what this means or send me a...
[3 replies] Last: thanks for your help, I was also able to dig this up "what the vir... (by foobarbaz)
by nammae
String
 
I get a problem when I try to compile this code: // pointer and string #include <iostream> using namespace std; int main () { char myStr = "I a...
[1 reply] : This is a weird thing C/C++ let you do. The are just shorthand for ... (by Disch)
syntax error identifier string.
 
Hi, I'm getting an error C2061: syntax error : identifier 'string'. Could you help me please? class Person { public: Person(string stName); virtual...
[2 replies] Last: I get about 500 errors from this project. Oh well maybe it was setup w... (by foobarbaz)
mod manipulation of an array trouble
 
help, I can't figure out why this will not work. I am trying to get my loop to cycle through an array checking each variable against 'mod 2'. If array vari...
[2 replies] Last: worked like a charm. thanks much. (by johann2)
Error checking for a beginner
 
Can someone tell me how to make program only except digits. I am a beginner so I will need it in laymans terms. Thanks in advance -James
[13 replies] Last: Nevermind.......I broke it down and I understand it well....Thanks eve... (by collinisaac0104)
by ajwest
while loop won't repeat
 
my program is about a menu of different shapes will be shown to a user at the beginning of the program (and again after each calculation). The user will sele...
[2 replies] Last: I want it to repeat untill they enter 5, beucase 1-4 are calulation fo... (by ajwest)
Program closing
 
During my moveLocation function sometimes the program will just randomly close and exit with code 0. Any help as to why this is happening would be appreciated!...
[1 reply] : Trying run Cout with all variables at the very top. Run the program 4... (by businessman332211)
multiple if else statement trouble
 
#include <iostream> #include <conio.h> #include <cmath> using namespace std; int main () { double x_coordinate, y_coordinate, point; cout.setf(ios::...
[6 replies] Last: thanks Disch, I didn't know that == was not a good idea with floats :) (by BettyBoopTS)
Switch Statement Brackets
 
Generally I don't use brackets with the case's of a switch statement. I recently realized you have to if there is something inside the case part that does varia...
[4 replies] Last: I wouldn't say it's bad, it could be good if the program is quite a la... (by gcampton)
February 2010 Pages: 1... 1617181920... 32
  Archived months: [jan2010] [mar2010]

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