Beginners - September 2015 (Page 25)

Simple Program with Build Errors
 
Hi everybody, I'm a beginner trying to write a simple program to transpose a matrix, using CodeBlocks. I keep getting build errors, such as "expected identif...
[4 replies] Last: wc bro. (by akash16)
Passing user-input array size to constructor
 
Im writing a simple program that records the quiz scores of students. It starts with asking the user the number of students in the class. I use this number to m...
[9 replies] Last: As I said before it's probably all dependent on your compiler. That co... (by Renthalkx97)
by spex
map to function via pointer.
 
i'm have a hard time with a map that is passed to a function and then adding to that map, for whatever reason my book doesn't seem to cover this. #includ...
[4 replies] Last: It's personal preference really. Pointers and references basically bot... (by Renthalkx97)
Passing a 1 dimensional array
 
Below is not my complete program code. The issue I wanted to focus on is when I use [g.playGiven("game 0", game0, dimension);] it doesn't appear to be passing t...
[3 replies] Last: Thanks for the help! Problem solved! (by JRimmer)
How to prevent a user to enter a space between characters and numbers
 
Hi, I'm trying to prevent the user to input a space between characters or numbers. The user can only enter 15 character with any combination with numbers. Any i...
[3 replies] Last: I meant software-wise. On windows you can hook into the console and do... (by Renthalkx97)
for loop not working
 
I wrote a program that is supposed to give you the amount of credit accrued after x number of months at y percentage rate. I attempted to write a function with...
[11 replies] Last: That didn't seem to compile for me. I figured it out though. Stupid ... (by happylivn)
I need help with Program Please
 
A program that calculates the total of a retail sale. The program must ask user for retail price of item purchased and the sales tax rate. The program should th...
[10 replies] Last: Thanks everyone you saved the day :) (by rave2014e)
by emsiwx
Check the http return code
 
Hello, I would like to ask you for a help.... I am using TIdHttp component to get files from the web. What I need is to include the check if the file is on t...
[no replies]
About calculating pi
 
Hi guys! I am new to C++ and I am taking a C++ class in college now. My professor gave us a hw and the problem is "An approximate value of pi can be calculated...
[2 replies] Last: No it doesn't. You're simply fixing the incorrect output by adding 3. (by Renthalkx97)
Vector with arguments declared in for loop not acting right
 
This code compiles correctly, but the las cout statement returns "(0,2.42092e-322)" The input file I used is 2 4 (0,0) (0,1) (0,2) (0,3) (1,0) (1,1) (1,2) (...
[10 replies] Last: I guess that solves it? (by closed account 48T7M4Gy)
Attempting to initialize 2d bool array: Not working as expected
 
Not sure why I am getting "true" Values. int main(){ cout << "BOOL ARRAY 1 " << endl; int xSub0 = 10; int ySub0 = 10; bool boolArr1 = ...
[1 reply] : I get all false values when I run it. It might be a compiler issue. Wh... (by Renthalkx97)
MadLib Needs Help
 
I was putting together my MadLib but my professor gave little to no instruction on how to do so and for some reason the file isn't compiling or running correctl...
[7 replies] Last: // Hmwrk02 // This program outputs a Mad Lib using variables input by... (by closed account 48T7M4Gy)
REading in from a file
 
Hello cplusplus users! I am trying to read from a file and display the contents as output. My code is as follows: #include <iostream> #include <fstrea...
[7 replies] Last: Perhaps it was the file path on line22 Make sure it is to the locatio... (by CodeWriter)
How do I get validate inputs that requires a number or letter?
 
Hello everyone, My program requires that I use a menu for the user to select an option. The options are 1,2,3, or D(Exit). My issue is that my function will re...
[7 replies] Last: Thank you JLBorges, that cleared up everything. (by jpanther)
Hailstone Sequence Is Incorrect
 
I need help getting the first value of the longest hailstone sequences that begin from 1 to n. This is what I currently have: /* next(n) prints the hailston...
[no replies]
by slate0
Constructor Syntax Uncertainty or Mystery Word
 
I am tasked with reverse engineering a large ancient codebase. I have found the following operator overload in class_String.hpp: class_Boolean operator== (...
[2 replies] Last: You are right, thank you. (by slate0)
If/Else statement issue
 
I'm writing a simple code for class. Prompts user to enter a number then tells them that number and also states whether is negative or positive. MY issue is , w...
[3 replies] Last: for char you have functions like getc or getchar there is also a func... (by Ericool)
Trouble with ordering array in least to greatest
 
Hi. I'm very new to C++, and I've tried here to order the array from least to greatest, but I get this output. Enter 3 numbers, do not enter any negatives. 1 ...
[1 reply] : you 've only initialize low . int big = 0; int med = 0; int low = 0;... (by Ericool)
error: expected primary-expression before '<=' token HELP!
 
#include <iostream> #include <cmath> using namespace std; int main() { float a; float p = 10000; float r = .01; for(int day = 1; <=2...
[6 replies] Last: No, he did not. Watch it closely. You are missing something. (by MiiNiPaa)
Simple IF Question
 
I am writing a simple math quiz which involves random numbers. After the user has finished the quiz, they are asked to retry the quiz. To try again, they must t...
[4 replies] Last: Awesome (by MokkaTech)
September 2015 Pages: 1... 2324252627... 42
  Archived months: [aug2015] [oct2015]

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