Beginners - November 2008 (Page 4)

cin problems(think)
 
(using windows xp):program doesn't seem to want to execute cin(im using cin here so window doesn't just close) code is [#include <iostream> #include <f...
[3 replies] Last: It's all good :) (by firedraco)
Calculating Prime Numbers
 
I am trying to calculate all the prime numbers up to a number entered by the user. The algorithm is laid out for me. I'm using 'Erasthones Sieve'. It's laid out...
[7 replies] Last: > I am not dismissing the advice. I am explaining exactly what I am do... (by Duthomhas)
by Taz
odd digits
 
Hello. I have a "long" tipe number. How can I interchange the biggest odd digit with the smallest odd digit? Example: 34921 becomes 34129
[6 replies] Last: I think the easiest way is to remember the amount of numbers. In the e... (by Scipio)
by amyotm
Push & Pop
 
I'm writing a project for class, and I was wondering if there was a push & pop function already built into the code that I could manipulate. Something like p...
[1 reply] : Most standard containers have these: http://www.cplusplus.com/referen... (by Bazzy)
by cvdpr
Read a File and then Group the Same ID and Cout in C++
 
Hello there , i know the basics of ifstream , loop while not eof etc.. but my problem is How to group the ones that has the same ID and the items sum? my IfS...
[1 reply] : I think you could do this by using standard containers: //declarat... (by Bazzy)
by taklct
how to print this format??
 
the format like this ===================================================== || Record || Student ID || Name      || Programme || Year || ...
[5 replies] Last: cout.setf(); sets the alignment for setw() : cout.setf(ios_bas... (by Bazzy)
by Novice
Displaying Numbers
 
Can some one tell me how to get a number to display with a zero before it, eg 5 to be displayed as 05 or 20 to display as 020. I want to use it as in minutes...
[6 replies] Last: Gee - I don't even know how that works. I just can't seem the understa... (by bluezor)
by jrock
strucutres problem...need advice
 
#include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; struct Bureau { char Name ; int TelephoneNumber; char SpeakingTop...
[3 replies] Last: thank you it works now (by jrock)
strings: at and length methods
 
/* I am supposed to use the at and length methods. The program needs to accept the a string containing a person's full name in the format of first name space la...
[4 replies] Last: So I guess the find method is out, too... Well, here's some help: ... (by seymore15074)
by rdabra
parameter of abstract type
 
I'm constructing a class MTArray2D with the followin code HEADER ... virtual double operator|(MTArray2D other) const = 0; virtual double inner_product_with(...
[1 reply] : You are passing an MTArray2D by value to operator|. This means the co... (by jsmith)
Error with stringstream
 
Hi, I'm just doing a test with stringstreams for another program I need to write so that I know I understand what stringstream does. I'm getting a message at th...
[14 replies] Last: I barely know what I'm doing. What do you think I'm in a help forum fo... (by TheHaughtyMattress)
by roblf
Class does not expose public enum...?
 
Hi, I have a class definition in a header file Game.h which looks like this: class Game { public: /// Enumeration of the possible overall ...
[7 replies] Last: Thanks for replying everyone. As I want to avoid writing non-standard... (by roblf)
no string just hex?
 
I've included string: '#include<string>' but when I try to make my variable a string it doesn't want to work. Also, when i execute the program, it comes out in ...
[7 replies] Last: Remember that a stream is not a string. You have to either read the fi... (by helios)
An array comparing another array.
 
Hi there, I would like to ask about an array of any comparing another array of the same type. Lets take an int array for an example, the first one comparing wit...
[6 replies] Last: ok anyway thanks. (by mrgoogle)
Operator Overloading for a Nested class
 
Hi, I'm trying to overload the << operator for a nested private class. I have a situation like: class A { public: class B { private:...
[3 replies] Last: Making operator<< a friend is typically an acceptable solution, althou... (by jsmith)
by newb17
array question
 
Hi, i want to get the user to input a number, and this creates an array with the size of the number enter. i tried this cout << "Enter number of values y...
[5 replies] Last: You coul use a List http://www.cplusplus.com/reference/stl/list/ (by Bazzy)
Square Rootin' and Tootin' (out the answer)
 
Hey, I was wondering if anyone knew (Zaita, most likely...) how to write out the square root algorithm into C++ to make it spit out the answer to what the user ...
[4 replies] Last: To calculate the square root of a number you can use the predefined li... (by hetrox)
internet games
 
Hi. How can I make a game like chess or tic-tac-toe so that it can be played over the internet?
[4 replies] Last: Your question is a bit ambiguous, I'm not sure if your exptecting some... (by Umz)
Creating a simple, visual C++ app
 
Hi, I'm new here, I got Visual Studio for .NET the other day and was capable of creating, in C#, an application that uses values entered in an Edit object, but ...
[1 reply] : i think you mean something like: class someClass { public: in... (by Umz)
by dhanny
cin>>manip
 
Hello! I need to create a function - input stream manipulator(with arguments). I managed to create the function, but how can i make it work like this: int ...
[8 replies] Last: ok guyz thanks for the answer.i solved my problem (by DarkFire21)
November 2008 Pages: 123456... 19
  Archived months: [oct2008] [dec2008]

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