General C++ Programming - March 2011 (Page 21)

map of member function pointers
 
Hello, I need some help on this problem : I would like to be able to register pointers to member functions (with a defined signature; lets say : <int, std::...
[6 replies] Last: Hello, thank you very much for your help. I will try to use the type ... (by naaokth)
How to create rooms in a game
 
I am makeing a text based game and I would like to know the code to make rooms
[6 replies] Last: Yea, i caught my coding mistake on my name, () not (by modernmenace)
Linked list sorting Desperate!
 
Hello, I really need help, ive been doign this ONE fucntion all day and I have gotten no where, the assignment is due TOMORROW! I have a linked list, and wha...
[8 replies] Last: NVM! it was in the first if statement duh again, brains are definitely... (by tkauffman2)
boost::bind
 
So, I have a function that basically looks like this: template <class T, class save_func_type> inline void save_container(std::ostream& file, const std::st...
[3 replies] Last: I was looking at the documentation and it looks like it is an issue wi... (by firedraco)
[SHARE] A real multi-dimensional dynamic sequential-memory array allocator.
 
I worte a class recently, and found it very basic and useful, so I'd like to share it. Features: 1. By real, I mean it's not simulated by or wrapped in ...
[no replies]
by avnis
could you please give a basic structure or hints, i need it asap :(
 
write a program that will read files of numbers into a vector, compute statistics relating to these numbers and distribute a vector of numbers into two vectors ...
[14 replies] Last: Sorry to have responded so late. A very quick pass shows that on lin... (by Duthomhas)
Bitwise operations: get non-repeating bits
 
Hi to everyone. I'm really stuck with it. I have an array of 9 ints (9 bits each). One, and only one, of these will always include 1 or 2 bits that the oth...
[3 replies] Last: This deals with only 8 bit numbers and runs in O(n) with c = 1. #in... (by jsmith)
operator overloading: sources disagree (1,2)
 
I've been trying to get smart on operator overloading, but it seems that various sources disagree on how some operators should be overloaded. A book I'm usin...
[20 replies] Last: Oh, of course. Man, I hate making dumb mistakes. Thanks, simeonz...I'... (by mzimmers)
by smelas
copy one array into another
 
Hi, an array like this; int numbers = {31,28,31,2,31,10,31,31,9,31,3,31}; and I would like to pair the elements of the array like the following...
[5 replies] Last: This is also good to know. thanks to both of you,, below one works. ... (by smelas)
connection base de donn
 
slt les amis,est ce que vous pouvez m'aider a faire une connection entre visual c++2008 et une base de donn
[3 replies] Last: j'ai fait bcp de recherche = j'ai fait beacoup de recherche = I've don... (by filipe)
Switch within switch
 
are there any problems with putting a switch within a switch? Is there some special format, or do I just put in another switch with a diffierent variable?
[2 replies] Last: menu of shops you select a shop (theres the first switch) within eac... (by timmah1493)
Array Problem
 
Why won't it print the input value I give it for buy after I press '1'? cout << "Quantity: "; cin >> buy ; cout << buy << " gallons of water purchased!";...
[15 replies] Last: why does this work? Which space (0-10) is the input value for buy bein... (by timmah1493)
HELP ME T.T
 
Im in difficult situation for our project What is the structure for the search function in linkedlist?
[4 replies] Last: could you please give me some source code pretty please i am really n... (by king214)
Problem with vector destructor
 
The debugger shows these, the top 9. This occurs when I erase the last element in a vector. std::vector<my_moving, std::allocator<my_moving> >::~vector my...
[5 replies] Last: Not quite. erase() returns the next iterator in the sequence: list<a... (by kbw)
freeing malloc memory in C
 
Hello, I know that it is good to explicitly deallocate any dynamic memory in your program. But I was wondering what are the implications of not freeing any m...
[3 replies] Last: what are the implications of not freeing any memory allocated via mal... (by kbw)
Inclusion in pre-made headers and an introduction
 
Hi everyone, Firstly, I'm going to start with the second part of the title, my intro. My forum name (and just about any other online name) is "rider_eragon" ...
[2 replies] Last: Cheers for the response. That's good to know, but unfortunately, I've ... (by rider eragon)
Declaration of a numeric constant as 'unsigned char'
 
In C/C++, 128U makes it unsigned int , 128UL makes it unsigned long , etc. What suffix will make it an unsigned char ?...
[2 replies] Last: The char literals are between quotes. You can assign them to char , ... (by Bazzy)
by Gldnbr
Linked list help
 
I have this program that sorts an added list but something is wrong in the add function, I've been using breakpoints, something is wrong with the whole function...
[3 replies] Last: and more 1. in add() you should use template into the paremeter of ad... (by aiby)
Decode 32-bit string
 
Alright I have a 32-bit string that is nothing but zeros and ones. Each 5 bits represents a different section of the instruction format. Then the last section w...
[6 replies] Last: krishnendu, that worked like a charm. A lot less code than what I had.... (by kraigballa)
String array to int
 
I have a binary string that I am trying to convert into a decimal. In order to do that I have to access each number (0, 1) in the string. The num1 string = "00...
[9 replies] Last: strtol returns a long. You cannot assign it to a string variable. (by Abramus)
March 2011 Pages: 1... 1920212223... 31
  Archived months: [feb2011] [apr2011]

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