General C++ Programming - November 2014 (Page 12)

How to template float/double constants?
 
Hi, I have a templated class that can either use float or double as type. My question is now: What do I do with constant numbers in the code? Let's assume...
[1 reply] : template < typename T > struct A { static constexpr T half = T(1)... (by JLBorges)
by Millet
I'm not sure what's wrong with my functions, need assistance.
 
I have three functions in this code. One to return the average temperature, one to return the highest value, and another to return the lowest value. Here's my c...
[2 replies] Last: Functions need to be defined outside of main. If you're supposed to be... (by wildblue)
[HELP] Online Shop
 
/*take note that this is not finish yet, so the answer are always 1 and yes as of now My problem is how to debug it (sorry I am a newbie) I try to call the mai...
[3 replies] Last: Sorry, I don't understand the question. the process() function is decl... (by dhayden)
by ma11on
Weighted line of best fit
 
New to programming in C++, should be relatively straightforward for most of you guys. I have a file of 3 columns of data; x,y,z(sigma) My program reads th...
[2 replies] Last: // LineFit // Reads in a file of x, y, sigma data points from "xys_dat... (by ma11on)
Object Oriented Programming question
 
Hi everyone I am taking my first Object Oriented Programming class at FSU in the Spring of 2015. My question is what should I know, or have a firm grasp and und...
[4 replies] Last: Can you find out what the textbook is before class starts? the text... (by UGAman22)
ifstream into array problem
 
So i made a program that fills an array with random numbers and then puts those random numbers into a txt file. #include <iostream> #include <fstream> #incl...
[3 replies] Last: I declare all of my file objects at the start because my teacher requ... (by kbw)
Functions/Arrays Need help
 
The problem I'm dealing with is below(I have no clue where to start or what to do i need an educational answer) Add a function named remove that accepts an i...
[no replies]
Ogre on code blocks
 
Hey there! I just set up my code blocks and ogre. Then i followed these steps *** Compiler settings Tab *** Other options Sub-Tab -mthreads -fmessag...
[no replies]
set &get method
 
how i can do validation on this code help please #include"person.h" #include<string.h> #include<iostream> using namespace std; void person::setid(int id) ...
[1 reply] : Define "validation". And also: http://www.cplusplus.com/articles/jEywv... (by Zhuge)
stock market project
 
i need to project stock market with classes
[2 replies] Last: i have my code 5 classes with header and c++ file how can h get this a... (by eslamfcih)
Problems on program
 
#include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; class Student { public: int iD; string firstN...
[3 replies] Last: Your constructor does not do anything remotely helpful. It does not in... (by MiiNiPaa)
Greatest common divisor
 
How do I get the greatest common divisor of two numbers in C++? Please give me an explanation. Thanks in advance
[1 reply] : There are several algorithms described here. https://en.wikipedia.org/... (by kbw)
help please
 
Anyone know why this doesn't program doesn't work? #include <iostream> #include <fstream> #include <string> using namespace std; class Student { public:...
[1 reply] : Please, describe the " doesn't work " with more details. (by keskiverto)
by anup30
extract COMBINATIONS to vector
 
hello. int ar = {1,2,3,4,5,6,7,8,9}; i have to take 5 numbers(any order) each time so total combination = 9! /( 5! *(9-5)! ) =126 how to put them in a ve...
[3 replies] Last: I'll use "NcM" to mean "N choose M". Given a set of N elements, NcM i... (by dhayden)
Help With Output - Arrays, Pointers, Functions
 
Hey all, my assignment was to write a program that asks a user for the number of inputs that they want, then for an array of that length. Using functions, and ...
[1 reply] : That's pretty nice code. It's easy to read, well organized and does wh... (by dhayden)
why doesn't this program work?
 
I built this program but the decoder does not work properly. #include <iostream> #include <string> using namespace std; int main(void) { char user ,ch...
[15 replies] Last: @jasonwynn10 Sorry, I won't be able to help out. (by whitenite1)
HELP!!!
 
how to count number of operation for below equation- total=(X*(x-2))/3 if x=8 total= 16 there are 3 mathmatical operation happening(*, /, -) but i don't k...
[2 replies] Last: ya, actually the formula is something else, i was just practicing to t... (by sshorme)
file wont print out
 
How come when i open the file output nothing is there? file.close(); fstream output; output.open("Output.txt"); output << (people-count) <<...
[2 replies] Last: First of all, you should ALWAYS test the stream first: if(!output) {... (by Seag)
Comparing elements in 2-dimens. array
 
Hello everybody, I'm trying to improve my C++ skills on my own, So I need a little bit help, Hope you can help,here's my question: I need to write a programm ...
[no replies]
Multiple account login problems
 
How can I be able to use more than one account? Please Help! **Updated** Code: #include <iostream> #include <string> #include <fstream> #include <stdio.h> #inc...
[14 replies] Last: ok, now I need a way to be able to have more than one account usable, ... (by jasonwynn10)
November 2014 Pages: 1... 1011121314... 32
  Archived months: [oct2014] [dec2014]

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