General C++ Programming - June 2010 (Page 15)

by everid
virtual and virtual table
 
1. where is virtual table? is it on the disk, in the object file? or is it in the memory, in the code segment? 2. if it is in the object file, then why inl...
[4 replies] Last: thanks. (by everid)
the <hash_map> header file from STL is letting in multiple keys
 
I am trying to build a hash table to get rid of duplicate data that I have, but the number of entries in my hash table keeps on changing. Upon doing some debugg...
[2 replies] Last: http://msdn.microsoft.com/en-us/library/617f83za(v=VS.80).aspx The ... (by strawberryfruit)
by cg9289
Binary to Integer conversion continued
 
I am trying to read a .bin file and convert the results into either integers or doubles, write to a vector to run through an algorithim. I ran the following ...
[5 replies] Last: Then I suspect that you don't need to be reading the file in as one ... (by Galik)
by jhapk
Template Specialization
 
Hi, I have a dummy templated function int Wall_Distance(Hexa_Block<SOLN_STATE> Solution_Block){ int error_flag(0); return error_flag; } ...
[4 replies] Last: template <<SOLN_STATE> You need a space between the left-pointing ... (by Albatross)
Any way to point a function pointer to a functor?
 
Consider the following snippet: #include <iostream> class FunctionObject { void operator()(int y, int j); }; int main() { void (*functorPoint...
[2 replies] Last: You can use boost::bind, which is just a more general way of doing wha... (by jsmith)
How to handle dynamic memory allocation failure properly?
 
Hi, I have been perusing the web and I haven't found a concrete answer for this but my question is: Unlikely as it may be these days with the amount of RA...
[7 replies] Last: +1 Athar. Do nothing. That's what most applications do. (EDIT: ... (by jsmith)
Problem with SDL_gfx
 
I am just new to SDL. I'm trying to create a line on the screen. I keep getting an error message saying "undefined reference to 'lineRGBA'". Here's my code: ...
[no replies]
Void return type and no return type
 
Constructor and Destructor have "no return" type not even "void". What is difference between void return type and no return type in C++ because void also ...
[3 replies] Last: Thank you forl the replies they have been very useful :) (by Aurelio)
Desk checking
 
Can anyone try a desk check and see what you come up with.I will be glad for an explanation.To me the result is 11 and 16. But execution gives 12, 18. Con...
[2 replies] Last: int m = 1, n=5; //m=1, n=5 m = n++; //m=5, n=6 m += n; //m=11, n=6 ... (by Athar)
by cg9289
Conversion from binary to decimal for data manipulation
 
I wrote an algorithim that reads from a .txt file. We have had some complications with software we are using and now have to read in from a .bin file. My sol...
[4 replies] Last: Wow tons of help guys, way more than I expected Thank you very much ... (by cg9289)
Overwriting problem with IRC bot
 
Ok, so this is kinda complicated and I'm completely stumped. I'm writing a bot for IRC that will play blackjack. I used a skeleton for a bot that I found onl...
[10 replies] Last: Found the problem. It was trying to copy the cUserNick (a char*) to pl... (by tvwenger)
list of #'s in a string --> int array
 
For example, I have a char array/string: "20,1,1,12,21,11,23,2,2,21,1,1,0,30,0,0,0,1,1,1, 2,3,3,13,1,1,3,3,21,11,1,22,3,2,12,12,13,2,2,2, 32,3,33,3,33,23,3...
[3 replies] Last: Consider another approach: #include <iostream> #include <sstream> ... (by moorecm)
by R0mai
boost::property_tree doesn't work under VC++ 2010
 
Did anyone else tried to compile ptree with VC++2010? I tried compiling: http://www.boost.org/doc/libs/1_43_0/libs/property_tree/examples/debug_settings.cpp...
[2 replies] Last: As far as I've seen, boost libraries were designed to compile on every... (by R0mai)
by antx
arithmetics and rational numbers
 
Hello, I am looking for libraries in order to compute advanced arithmetic operations (gcd...), and another one to implement rational numbers (I know it's ea...
[2 replies] Last: Thank you, it seems perfect ! For those who speak french and would ... (by antx)
by loolyn
Converting image to base64
 
Hi All I need to programatically convert an image to base64, to put it in vCard. Does anyone know where I can find a code for doing this conversion from ima...
[no replies]
by RcSepp
Readonly variables
 
Hi, now this has always been the single most annoying thing about C++ to me and I would really love to have a solution for it. Common case: You have a var...
[7 replies] Last: class Foo { public: int GetFoo() const { return foo; } ... (by jsmith)
Type Mismatch?
 
I keep getting an error when trying to use a matrix class someone else wrote about 10 years ago in VC++ 6.0: Optimizer.cpp:48: error: no matching function f...
[19 replies] Last: +1 kbw. But, to answer OP's question, any parameter passed by (non-... (by jsmith)
list problem
 
I use one list<string> object to store the file names in one directory. There is a function called ScanDiretory(list) which adds file names into the list. In th...
[4 replies] Last: Thanks. Got it. (by RobBinS)
Whats the standard here and why?
 
I am attaching this simple code snippet which compiles fine with MS C++ compiler v15 ( which comes with Visual C++ 8 ) but fails with MS C++ compiler v16 ( Visu...
[15 replies] Last: I have to say that I think Sid is getting a bad rap. He posted a le... (by Galik)
by Sophie
About adding library to a project in VC++2008 Express Edition
 
Hi, I am new to C++. Right now I am working on a project using VC++2008 Express. I would like to add a library file "c:\ProgramFiles\MicrosoftVisualStudio...
[1 reply] : to use a library, you have to write its path in project->properties->... (by hamsterman)
June 2010 Pages: 1... 131415161718
  Archived months: [may2010] [jul2010]

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