Beginners - November 2011 (Page 31)

Get highest number of X numbers
 
Hi, I know how to get higher numbers of 2 int a = 5, b = 3; if(a < b) { } else { } but how can I get highest number of X numbers? let's say I...
[3 replies] Last: Put the five numbers in a vector. Use sort. http://www.cplusplus.com/... (by Moschops)
undefined reference to...
 
I'm getting the following error: undefined reference to 'IntStack::allocate(int)' on line 72 of the intstack.cpp file. intstack.h #include <stdlib.h> c...
[2 replies] Last: Oh boy, haha. I'll blame that one on being tired. Thanks. (by AndroidZ)
by Blaed
Segmentation fault error
 
Hello, I am trying to write a program that reverses two strings, I though I had it done pretty well but when I run it, the program runs till line 26, then I g...
[1 reply] : you just cannot do it like you do it in your 'reverse()'. string is no... (by coder777)
by nadavr
Help with Linked List / Array
 
Hello, I've received an homework assignment to create an array via linked list. All went well until the compilation part where i get continuous errors. See...
[2 replies] Last: I apologize .. Basically i get all kinds of errors but it seems all a... (by nadavr)
by moot1
whats wrong with this
 
it says the error is on the underlined piece of code #include <iostream> #include <string> using namespace std; int main(){ char question = "en...
[2 replies] Last: You cannot have << endl when initializing an string array. If you w... (by coder777)
setw a table?
 
I having problem with how to make a proper column and hard to understand setw.. // setw example #include <iostream> #include <iomanip> #include <conio.h>...
[4 replies] Last: nevermind.. (by Eldy Voon)
Calculating weekday
 
Ok I'm in the middle of another assignment, for which I won't paste the whole code because it would take up at least a page and you would give up halfway throug...
[2 replies] Last: Here is my attempt: #include<iostream> using namespace std; #include... (by stridexr)
Help regarding calculation conditions
 
It works like this - 1)User enter his particulars such as name, date of birth, etcs. 2) I have this formula that actually have different tax calculation for ...
[6 replies] Last: Hey William, it's working now. I'm able to extract the age and print o... (by Tampopo)
Problems with a problem
 
I have been asked to: Create a person class to represent a person. (You may call the class personType.) To simplify things, have the class have 2 variable memb...
[1 reply] : First of all, welcome to the forums:) From the assignment description... (by fafner)
by gh24
Recursion Help Needed
 
Hey Guys, My code is as follows: float american_asian_call_option(int k, int i, float current_stock_price) { if (k == no_of_divisions) return max(0.0, (c...
[7 replies] Last: The reason it is mostly functions is because it is using recursion. T... (by gh24)
by RapidX
Recursive functions
 
Hello everyone, In a book I'm looking into, I came across recursive functions. I understand the basic idea of how recursive functions work, but can anyone te...
[6 replies] Last: Ok, so you were suppose to declare a char * originally, not a char t... (by WilliamW1979)
by abiz
reading from .txt file
 
Hello everyone, i'm still learning C++ and having trouble reading text files and putting them into strings. #include <iostream> #include <fstream> using n...
[5 replies] Last: I have found what i was looking for, thanks everyone for the input :) ... (by abiz)
by sman
easy ones for somebody
 
I'm looking for help on 2 seemingly easy codes. Does anyone know why this code returns 10? Shouldn't it return 50? the if statement says if a = b, which is doe...
[4 replies] Last: I like that method, I never purposely doing that. (by WilliamW1979)
A little problem
 
Problem is on the function populator. When I cin it only asks for 6 answers. But i need 7. Telephone part is totally missed out. #include <iostream> #incl...
[16 replies] Last: You can use them if you like, they are the older versions of cin and c... (by WilliamW1979)
Explain push_back please
 
Ok, this is the code #include <algorithm> #include <ios> #include <iostream> #include <string> #include <iomanip> #include <vector> using namespace st...
[2 replies] Last: You explained it great, imo. Thanks alot, i understand it now! (by Dstrayex)
program doesnt prompt for input in getline()
 
string studentName; string studentGender; int studentCapacity; int n =0; cout << "Insert n:" << endl; cin >> n; Student* student = ne...
[5 replies] Last: well. It worked for me. Getline should get the line. It clearly works ... (by biplav17)
by lirik
Help on terminating a program
 
if ((( Year % 4 == 0) && (! ( Year % 100 == 0))) || (( Year % 4 == 0) && (! ( Year % 100 == 0))&&( Year % 400 == 0))) { cout<<"The Year "<<Yea...
[6 replies] Last: great! :) (by biplav17)
How to sort?
 
Hi i need to create a program that will accept 10 numbers as input. Output the list of numbers in numerical order. I have it to were i can accept 10 numbers but...
[6 replies] Last: after you have filled the values of the array (by biplav17)
How do i go about doing calculation function?
 
Say, i have a display() that display the name and particulars of a employee. I have a base class Employee() and 2 derive class TempEmployee and ContractEmploye...
[12 replies] Last: is it possible to do a addition of every staff gross salary in the arr... (by Tampopo)
by moot1
string
 
can you guy please explain strings and characters to me and how to use them...thx
[1 reply] : to use string you include the library and use it as varaible. char is ... (by biplav17)
November 2011 Pages: 1... 2930313233... 65
  Archived months: [oct2011] [dec2011]

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