Beginners - April 2013 (Page 12)

Class Help Needed
 
Create a class Hangman with the following private attributes:  Words: should be a static array of character pointers with 5 elements.  Word Name: shoul...
[1 reply] : What kind of help do you need with your homework? Currently it seems ... (by keskiverto)
by Jaffar
Giving precedence to the mathematical operators
 
Write your question here. I am having difficulty in giving precedence to the mathematical operators i.e. I want to implement the "DMAS" rule of mathematics. Ca...
[1 reply] : Operators in C++ do have precedence already. Level 6 * / % multiplica... (by keskiverto)
Gross_total wrong...
 
everything works and calculates except the Gross_total. I don't know what is wrong with it. Help please! /********************************************...
[4 replies] Last: @ aflangdon Just some style points. First is your variable names - ... (by TheIdeasMan)
First program with regex not working
 
boost::smatch matches; recvFIFO = "This Was Last-Modified"; const boost::regex pattern("Last-Modified"); const bool found = boost:...
[2 replies] Last: This small distinction was the key, thanks! (by bartoli)
structs/arrays
 
struct SDate { int month, day, year; }; struct SMachineRec { int idNumber; string description; SDate purchaseDate; float cost; float payment...
[1 reply] : Your homework, isn't it? Go ahead and do it. You will learn by doing.... (by keskiverto)
independent sort
 
how would i rewrite this function to sort alphabetically by case? i did it dependently course* sortByDescription(course* head) { course* newHead = 0; ...
[1 reply] : Write your own comparsion function: int istrcmp(const char *s1, const... (by MiiNiPaa)
by vivre
Global Variables
 
My friend has recently responded to a member of another forum with this: The reason you use global variables is to allow the use of the variable throughout the ...
[2 replies] Last: You can dereference uninitializated or null pointer ergo dereferencin... (by MiiNiPaa)
Counting the number of characters and lines in a given text file
 
So far this is my code. It needs to take from a text time (textfile1), read it, and output how many characters and lines it has. But right now all it does it ta...
[1 reply] : You read one line at a time. Every time you read a line, the number_o... (by keskiverto)
Declaring an object that is an array?
 
I have to declare three objects of arrays with a named constant for the size. This is how I have it declared but in my program it says I have an error. and Cou...
[16 replies] Last: I can name it anything I want but it was course but its asking for peo... (by closed account LN3RX9L8)
by kabuki
Help with if/else if
 
How would this code look like if it was in if/else if? if (hours <= 40) {gross = hours * payrate; ovthours = 0;} if (hours > 40) {ovthour...
[3 replies] Last: It will, but do not overuse comma operator (this can lead to unexpecte... (by MiiNiPaa)
Trying to use object declared in main in another Class
 
Hey guys, im trying to use an object that i declared in main() and use it in another class, but im getting an undeclared variable error. Player Class: class ...
[3 replies] Last: http://www.learncpp.com/cpp-tutorial/73-passing-arguments-by-reference... (by MiiNiPaa)
Need help with cout!
 
So when I input my name, Ryan, it says: Nice to meet you -858993460, have a wonderful day! :) but Its supposed to say Nice to meet you Ryan, have a wo...
[3 replies] Last: Figured it out, I needed to add #include <string> thanks! (by HadMuffin)
problems
 
this is my assignment and below is the my code where am I wrong?....Write a program that simulates the tossing of 3 die and computes the probability of obtainin...
[2 replies] Last: thanks lol (by cmiller9732)
by zmlink
please help me figure this out ;/
 
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv ) { int amount, newAmount, interestRate; cout <<"Please e...
[1 reply] : if possible could someone create the last steps and use // to explain ... (by zmlink)
sum and average of array
 
this is what code i have and i need help finishing thanks!!! Write a program that demonstrates using an array to perform some simple statistics. Your program...
[9 replies] Last: You should study the basics again, get a good C++ Book -size Bible- ch... (by eyenrique)
if/else and goto
 
I was messing around with user input in code, and wanted to see if an invalid statement would reset back to the original prompt again. However... #include...
[7 replies] Last: STYLE ALERT Things you should consider. #1: INDENT. Don't be ... (by Disch)
Random number
 
I was trying to make 16 random number That is from 1-8.And every number should show twice, how can I make it? The only thing I know is for(int i=0;i<16;i+...
[1 reply] : well for one. You are missing your srand(time(NULL)) and for two makin... (by giblit)
Access violation, Project Options
 
So, I just installed Dev-C++ V.5.3, and the problem is that, whenever I want to access the project options, I receive this error: Application version: 5.3...
[1 reply] : I would suggest visiting http://sourceforge.net/p/orwelldevcpp/forums/... (by cire)
Question about code in a tutorial series
 
The question is about something near the beginning (about 2 minutes in) http://www.youtube.com/watch?v=GoMNA4dYXvE I was wondering why he made made T constant...
[3 replies] Last: Thank you. (by AlitCandle)
the homework
 
Problem: write a float A/B=1/a1+1/a2+... such as 5/6=1/2+1/3 7/8=1/2+1/4+1/8 #include <iostream> using namespace std; int main() { int c ;...
[no replies]
April 2013 Pages: 1... 1011121314... 83
  Archived months: [mar2013] [may2013]

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