Beginners - October 2009 (Page 19)

Sum a sequence of integers
 
I need help with this bit of code. First integer is the number of values remaining to be entered and only one value can be inputed per statement. So if I en...
[8 replies] Last: #include<iostream> using namespace std; void main() { int iNum... (by rave003)
For LOOP Error
 
#include <iostream> #include <string> using namespace std; int main() { double amount; int numyears, years; double realizable; ...
[1 reply] : You have two sets of brackets and have not initialised Realizable as i... (by narcissisticcheer)
by hannes
static member methods
 
Here is an example: #include <iostream> using namespace std; class tmp2 { public: void test() { cout<<"we are now in the function 'test'"<<endl...
[1 reply] : . is used to access data in a specific object (e.g. object.member) and... (by helios)
setsuspendstate() ... with hiberanting a computer
 
#include <iostream> #include <powrprof.h> #include <std_lib_facilities.h> #define new '\n' using namespace std; int choice; int main () { top: ...
[9 replies] Last: can some one please not criticize me and just help me please... Criti... (by helios)
something like string to int? didn't solve yet
 
Hello! Im trying to make a program that you tipe in any numbers as a string and the program sums them, like this: Enter a number:4865 and then it would...
[8 replies] Last: And how i should do that? modulus the % symbol is used to get the... (by gcampton)
foo1(bar &x), foo2(bar &x), foo3(bar &x) ...a better way?
 
Is there a better way to do this? Currently, the user being passed into all those functions throughout the program is always the same, so is there some way I ca...
[2 replies] Last: Currently, the user being passed into all those functions throughout ... (by helios)
Segmentation Fault on Delete [] (1,2)
 
My problem is that I keep a gettting a segmentation fault when I run the destructor for the PriceFeed object. It occurs on the following line: "delete _input...
[25 replies] Last: Next time, use a vector. :-) (by PanGalactic)
by sdot
expected unqualified id before '{' token???
 
I am trying to make a program that outputs a 5 letter word inputted by the user in various ways. whenever I try to compile my program using the g++ compiler I g...
[5 replies] Last: oh ok sorry about that (by sdot)
getline problems
 
How do I show 2 decimal places for a double value? example: if I put in 14 I would like it to show up as 14.00 It seems like it should be something very sim...
[6 replies] Last: Thank you both so much! My program now works again. :) (by Minifig)
Protecting CD/DVD s from copying or printing !!
 
Hellow Everyone! I have a problem and here's the thing... My dad is a photographer and he is in big problems.He often photographs weddings together with his f...
[18 replies] Last: wachtn (70) Oct 9, 2009 at 10:10am Obviously the only plausible expl... (by MYST)
#include <windows.h> (...) cin.ignore(numeric_limits<streamsize>::max(), '\n');
 
#include "stdafx.h" #include <string> #include <iostream> #include <fstream> #include <limits> #include <time.h> //srand( time(0) ); #include "templates....
[2 replies] Last: and before #include <limits> Thank you! (by Archaea)
Check if a field value is a float or int
 
How can I check if a user inserted value is a float number (or integer) as I'm expecting? Thank you.
[3 replies] Last: User had similar problem here: http://www.cplusplus.com/forum/beginne... (by Duthomhas)
two for statements and using pow()
 
Here is my problem: write a nested loop that displays a table consisting of 3 rows and 11 columns like so: 1 1 1 1 1 1 1 1 1 1 1 2 1 2 4 8 16 32..... 3 1 3...
[2 replies] Last: thanks abunch I was missing the cout<<i: (by studentm)
For Loop (i=1; i<10; i++)
 
Here is code that includes two switch statements to print out a two digit number entered, 1-99. I now need to add a FOR loop so it repeats up to 10 times. After...
[5 replies] Last: No, it still won't make sense. Basically the numbers 1 through 9 ar... (by jsmith)
begginer
 
this is the task: Given two positive integers m and n. Determine the number m n last digit sum. Sharing the figure should be quantified. the result is worng ...
[3 replies] Last: http://cplusplus.com/forum/beginner/15171/ In that thread I posted ... (by jRaskell)
linear equations problem
 
(algebra:solving linear equations) You can use Cramer's rule to solve the following 2*2 system of linear equation: a*x+b*y=e c*x+d*y=f x=e*d-b*f/a*d-b*...
[3 replies] Last: More complicated liner equations can be solved by Guass method. For d... (by eryar)
copy constructor and assignment question
 
the program is self-explanatory. My question is on line Base b = func(a); I thought there should be three copy constructor called in this line, but there ...
[2 replies] Last: thanks (by chrisben)
Need an opinion about the function of the following part
 
Can anyone help me about the function of the following part of a programm by givving me an example ? if (x > y) z = x; if (x == y) z = 0; if (x < y) ...
[2 replies] Last: That code sets 'z' to the maximum value ( 'x' or 'y' ). If 'x' and 'y... (by Bazzy)
function call error!
 
I got a problem with my code! #include<iostream> using namespace std; double depreciation( double,int); double realizable(double,double); int main() ...
[3 replies] Last: Notice this: double depreciation(double amount, int numyears) { ... (by Bazzy)
Questions about file operations (<iostream>)
 
Hi, As the the title say, this is a question about file operations in <iostream>. Say outfile contains "abc", the following ostream out = ofstream({outfil...
[4 replies] Last: http://en.wikipedia.org/wiki/Reference_(C%2B%2B) (by Duthomhas)
October 2009 Pages: 1... 1718192021... 25
  Archived months: [sep2009] [nov2009]

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