General C++ Programming - October 2009 (Page 9)

fstream with numbers
 
class something { public: int zero; int med; char one; friend std::ostream& operator << (std::ostream &stream, const something& thing) ...
[5 replies] Last: You can put whichever character you like but you'll need to use getlin... (by Bazzy)
static / Dynamic casting and references/pointers
 
Hi, I'm getting a bit confused while looking at static_cast and dynamic_cast while using references and pointers. I could really do with an idiots guide with...
[3 replies] Last: thanks for both the replies! I think it's slowly becoming clearer. ... (by MisterEd)
Use a non-refence variable to receive a refernce-type returning value
 
I have a function as below: template<class T> T& Front() { T a = 100; return a; } In the main function, I have: T b = Front(); In the Visual ...
[2 replies] Last: a in Front() goes out of scope before b is assigned to the value point... (by helios)
by ARWA
hello
 
hello every one; this my first participation .I have done until now 3 simple program :) i hope that i will be benefit for every one :) thank u .
[2 replies] Last: Please note that all code should go into the bbcode provided. (by closed account S6k9GNh0)
Customized "Compare" function for priority_queue
 
I have a structure "Event", for which I have defined proper comparison operators. I now want to use a priority queue in STL to save the pointers of Event, as be...
[3 replies] Last: Yeah, the "function object" works! Thanks very much to jsmith! :) (by Ramboiory)
STL Map: string vs int as key type
 
Hi, I was wondering when finding something in an STL map if there would be a large performance difference when using an int vs string as a key type? Could it ...
[7 replies] Last: I think boost has a variety of CRC algorithms you could use. Or you... (by jsmith)
sungka game
 
anybody heard of game called "sungka"? i was wondering if i could get some help making a game in C++ just for fun here's a discription of it: http://wik...
[12 replies] Last: Not knowing it's name, I've actually played this game on computer year... (by narcissisticcheer)
2D Vector - push_back, erase
 
std::vector< std::vector<double> > my_vector; I have this 2D vector. How can I insert a double element to position(0,0) i.e how can I push_back such that...
[4 replies] Last: vector.begin() does not return 0. It returns an iterator to the first... (by jsmith)
by jhelo
postorder program
 
good day! i'm here again asking for your help. We're making a program for postorder but don't know how. Do you have codes for here? I'm using the old version of...
[2 replies] Last: thank you. i now have a program that convert the nodes to preorder,ino... (by jhelo)
error C2662 const parameter
 
I have a class with 2 fuctions: COLOR_ENUM Flower::GetColor(void) { return m_Color; } Flower &Flower::operator =(const Flower &f) { m_Color ...
[6 replies] Last: 'Flower::GetColor' : cannot convert 'this' pointer from 'const Flower... (by player6)
by mgmsky
who can tell me?
 
i am coding in c++.so i want to know more about it. many prople think that java can do server for mmo game,they think java than c + + little worse.please tell m...
[1 reply] : http://www.research.att.com/~bs/bs_faq.html All about C++ http://www... (by bluezor)
Multiple operator definitions
 
Hi I have a very simple test case which I am trying to solve. I have the following classes and files: /*** MyClass.h ***/ #ifndef MYCLASS #define M...
[2 replies] Last: Okay it seems I was having one of those days. It probably has somethin... (by jamesm6162)
how to pass character array into and return it from function
 
I am having a problem where cant pass all my keyboard input into a function using character array and returning it as a character array. HEre is my code.I am u...
[9 replies] Last: Means where should i make the correction ? Please guide me... (by nsw1216)
by fi3
calculate total resistance value
 
somebody can help me to write a C++ sourcecode for me The question ask to calculate the total resistance in a circuit involve parallel and series connections o...
[4 replies] Last: It does not seem to me that you really understand the problem. What... (by turbozedd)
by Freon
auto_ptr assignment
 
Does anybody know why auto_ptr transfers pointer ownership on assignment instead of making assignment and copy ctor unavailable?
[4 replies] Last: Because you might want to transfer the assignment like this maybe: ... (by firedraco)
My error message: error C2659: '=' : function as left operand
 
I'm not quite sure why I'm getting this message. This is my whole code: #include<iostream> #include<ctime> using namespace std; int divide () { i...
[4 replies] Last: Function as left operand: #include <iostream> using namespace std... (by Duthomhas)
Reading data from a file character by character to find word count
 
I need to have my program open a file and output how many words there are in the file. The catch is that my teacher wants us to pretend there are no "string" ty...
[12 replies] Last: stil not working :/ anyone know how i can fix it? This is what i cha... (by Soujirou)
by R0mai
nested template syntax
 
What is the correct syntax here? template<class T> struct s { template<class U> void f(); }; template<class T, class U> void s<T>::f() { ...
[4 replies] Last: Well, I never thought this could be valid. Thx Bazzy (by R0mai)
Counting 1 Word in Array C++
 
Hello, This is my first post. I'm learning C++ right now, and I have an assignment with two programs. I'm lost like you would not believe. First Program: C...
[3 replies] Last: #include <iostream> #include <string> #include <cstdlib> #includ... (by mcleano)
Pointers to a class with attribute Vector
 
Hello all, Am stuck with pointers concept a bit. class myclass { stl::vector<double> list; }; main() { myclass *myptr; /* create 100 objects...
[5 replies] Last: It should work, but only if myptr still points to the beginning of the... (by helios)
October 2009 Pages: 1... 7891011... 17
  Archived months: [sep2009] [nov2009]

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