General C++ Programming - October 2010 (Page 2)

by Kiana
Pointers to class members
 
class foo { public: foo() { Handler = &foo::MyHandler; } int MyHandler() { return 0; } private: typedef int (...
[2 replies] Last: Thanks a lot! (by Kiana)
non-deterministic behaviour of a program
 
Hello, I have a general question about a C++ program execution. I was running the same program for several days without rebooting my system and everything...
[11 replies] Last: I was under the impression registers are not zeroed The compiler woul... (by helios)
LZW GIF compression?
 
I've been trying to figure this out for days now - how to decode GIF image data. Dozens of Google searches and articles describing it, and I still have no idea ...
[8 replies] Last: Ah, I knew I could find it! Here's Steven A. Bennett 's GIF decode... (by Duthomhas)
by NGen
getline With ifstream Object Returning Erroneous Values
 
After being bored at school and making a program that utilized the Beep function to annoy other students, I decided to try making it play the Mario theme. In or...
[2 replies] Last: I thought that using strm.str () would completely change the internal ... (by NGen)
Binary tree issues
 
Im trying to create a binary search tree out of some numbers from an input file, the tree is being constructed however, the sizes of each node ( meaning the num...
[no replies]
binary search problem
 
i want the problem to perform the binary search algorithm , to find the index of an element within an array , but the problem that it always inputs "not found" ...
[2 replies] Last: oh yeah , i forgot that binary search requires sorting , how stupid . (by TheBrain)
Calling a function
 
Trying to learn functions and having some problems. I create a function in a header file and then call this function from another program and I receive the erro...
[2 replies] Last: Or, if you're using an IDE: Make sure Test.cpp and Test1.cpp are bo... (by Disch)
LNK2019 and LNK1120
 
Can someone figure out why I am getting these errors? I am not an expert and I just don't see it. I am getting two errors. 1>hangman.obj : error LNK20...
[2 replies] Last: Also, use code tags from now on. (by closed account S6k9GNh0)
Logic at end of do while not working
 
/* This the necklace number program it will start with the 2 number that the user enter and will do the sum of the numbers till it gets back to what the 2 sta...
[2 replies] Last: i added what the program is to do now (by PrincessProgram)
Implicit conversions
 
In the following program: #include <iostream> #include <vector> #include <string> template <typename T>void printValue(const T &s) { std::cout << s ...
[1 reply] : You're apparently using a non-standard-compliant compiler. In g++, s... (by Athar)
Passing an inherited class to a function
 
Is it possible to have a function collisionDetection(Sprite sprite) which could also take inherited versions of the sprite class?
[1 reply] : Only pointers or references to them. see http://www.cplusplus.com/doc/... (by hamsterman)
by Juisoo
std::getline() and istream::gcount()
 
I just stumbled across the following: std::ifstream file; file.open("filename"); std::getline(file, str); std::cout << "Size of last get op: " << file....
[1 reply] : This lists the operations gcount() works with: http://www.cplusplus.co... (by Galik)
sequential search problem
 
hello i wanted to ask how to create a function that makes the insertion code search for an occurence that i will insert with a cin , instead of picking the fi...
[4 replies] Last: thx guyz the problem was solved (by TheBrain)
command line switches
 
I have been trying to develop a program that will calculate distances, mass, volume and others, but I am stuck at programming the switches, you know like in thi...
[11 replies] Last: You can loop through your args like this: int main(int argc,char* ... (by Galik)
Several questions about C++ STL. Thanks.
 
Hi, I coded a program with C++ which takes a lot of memory. I am trying to figure out why they need so much memory and therefore fix the memory problem. Listed ...
[4 replies] Last: About question 2: Use a memory debugger ( http://en.wikipedia.org/wiki... (by Bazzy)
NO ERRORS BUT IT WON'T WORK
 
IT GIVES NO ERRORS BUT IT WON'T WORK AND IT SAYS return code -1073741667 I CAN'T FIND ANYTHING WRONG CAN ANYONE HELP ME ? #include<iostream> using namespace ...
[1 reply] : problem solved 1.0 insted of 1 (by iuliana21)
Looking for bitset library
 
Hallo all, I'm looking for some good library, that works with bitsets or bitarrays. Anybody knows something better then boost::dynamic_bitset? No matter if the...
[no replies]
Dynamic memory allocation issue
 
Hello, I have a function which returns Char * as output.I want to pass this output to major function.Now I should allocate proper memory to store this particu...
[3 replies] Last: If your function returns vari, which is allocated on heap, then it mus... (by closed account S6k9GNh0)
end of line showing "^M"
 
Hi All, I am generating a data file and I need to put "end of line" for each line. The result to it, is that i see ctrl-M("^M") symbol in body data. eg: ...
[4 replies] Last: It's not a bug, it's a feature. But at least they fixed the "bush hid... (by helios)
C++ Calendar One Problem
 
Hello everyone, I am building a calendar right now that posts a year calendar after asking for the year and the first day of the year. I have finally perfected...
[no replies]
October 2010 Pages: 1234... 23
  Archived months: [sep2010] [nov2010]

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