General C++ Programming - May 2008

Stringstream odd behaviour
 
Hi, I'm puzzled, could somebody explain it to me why the following behaviour of stringstream? I consider the following programme: #include <iostrea...
[3 replies] Last: You are mixing things up quite thoroughly. You need to be careful how ... (by Duthomhas)
Creating dynamic function?
 
Just say I want to make a scripting language that support functions, and I want to implements WinAPI callback from user defined function in my script... W...
[1 reply] : You will need an intermediary function. The actual callback should ... (by Duthomhas)
Making application
 
i tried with c++ making application but i can do it just debug, how can i make application .exe even if somebody doesn't have C++ can run the program.
[5 replies] Last: OK, so MS C++ 2008 Express is your compiler/IDE. I guess from your po... (by Faldrax)
Function overloading error
 
I was writing a class to simplify networking stuff, so i defined a connect() function like so: int connect(string ip, unsigned int port); now in the cod...
[10 replies] Last: I should have spotted that one. Glad you got it sorted out. (by bnbertha)
by lyngby
Template and pointer and inked list
 
Hi all I have an assignment where I have to implement the abstract data type (ADT) Set which defines a set. The following applies to sets: There must only...
[no replies]
How do I truncate a decimal?
 
I would like to know how to change the last x digits, of a series of double numbers, to zeros. E.g. I would like to change 1.0034958675848392 to 1.0034950000000...
[8 replies] Last: what do you think of: float x = 1.0034958675848392; x = floor(x * ... (by Adler)
by idono
function or eqation error
 
the program has no error's when i compile but the problem is still not doing what i want it to do. it should work like this, i enter a number of days then the p...
[2 replies] Last: Carring on from the previous post and the variables.... It looks like... (by bnbertha)
Making a 2D array dynamically inside a class
 
I want to make a 2D array with values I set inside a class (using the constructor). How would I go about doing something like that? For example: class ...
[3 replies] Last: Dang, I knew I was going to have to get into allocating/deallocating m... (by firedraco)
input/output files
 
im writing a program that uses data from a .txt file. i have been working on this code for quite awhile now and cant quite get it. i want the file to extract ...
[1 reply] : while (answer != 'Q') { if (answer == 'L') { data.open("funds.t... (by foimyst)
Destructor List<t> question
 
Hi all, This may be a silly question but when you declare an list<t> linked list, does the class do the destructing of the list automatically or must you bulid...
[2 replies] Last: Thank you for your resonse regards Brendan (by boneill3)
by kenji
LinkedList problem
 
Hi, I am very new to C++ (C# is my normal language), I am having some problems with a LinkedList. Could someone please tell me where I am going wrong. I would r...
[4 replies] Last: I'm just going to point out. If you look up the C++ STL (Standard Temp... (by Zaita)
by idono
functions error
 
#include <iostream> using namespace std; //aaron hereford //this program asked the user to enter the temperature of freezing and boiling points and shows th...
[1 reply] : The problem is in how you are trying to use functions. The type befor... (by Faldrax)
manupulating function objects
 
hi! to make a minheap out of a vector "cont" the function is make_heap(cont.begin(),cont.end(),greater<int>) now this works if the contents of the vector "c...
[2 replies] Last: The top most element will be smallest and its children will be lesser ... (by eklavya)
Override operator= for non-class (ie primitive) types like int, char *, etc.
 
I have a problem which I can't seem to find others who have the same problem. I have a custom class, call it foomatic . I want to define how foomatic is refe...
[13 replies] Last: Does this offer any optimization benefits when using the const keywor... (by ropez)
I got issues while parsing my Textfile
 
Hi folks... I coded my concept like this for the below text file...... <$$$$$$$$$$$$$$$$$$$$$INPUT FILE$$$$$$$$$$$$$$$$> # c17 # 5 inputs # 2 outputs # ...
[1 reply] : Please post your code using proper tags. As explained here http://www.... (by Zaita)
NIM game source code
 
I need a little help to create a NIM game program in C++. It has 2 functions, first, int playermove() that outputs number of matches, asks player to make move ...
[2 replies] Last: yes it is a project that has more to these functions. but ok. thank... (by wander4heat)
by mikej
search based on two keys (1,2)
 
Hi, I have a data file in the following format. Date1 and Date2 ate Date fields in string format. Value1 and Value2 are integers. I want to read the file...
[22 replies] Last: Btw, I just wanted to add this ... As a beginner, when I read about m... (by mikej)
by next
Functionality of multiple operator overloading
 
I just needed to know if it was possible to overload and += simultaneously for a same context more precisely, I created a class called callback which basic...
[1 reply] : You can do that by returning a reference to an object from the opera... (by ropez)
Vector MergeSort Template error fixing
 
I have the following code with a few errors (That I do not know how to fix). The code replicates MergeSort for vectors. I know how to use sort() and merge(), bu...
[6 replies] Last: For your escaping. You may prefer to use: if ( (*left.begin()) <= ... (by Zaita)
PARSING THE TEXT FILE...
 
hi i am srinivas.. i got stuck with the following code while parsing my below text file.could you please give me the errors what i did in the code.the followin...
[2 replies] Last: I would have two functions - one function to sort out the INPUT / OUTP... (by guestgulkan)
May 2008 Pages: 123... 8
  Archived months: [apr2008] [jun2008]

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