Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 285
Search took 0.05 seconds.
Search: Posts Made By: Cache
Forum: C++ Jun 14th, 2008, 4:59 PM
Replies: 4
Views: 247
Posted By Cache
Re: Assigning a class function as a callback function

Here is an untested hint to calling a non-static member function in the callback. 'SNcallback' could of course be made a static member function of 'SNMP_worker' if you'd like.

struct SNMP_worker
{
...
Forum: C++ Jun 14th, 2008, 4:30 PM
Replies: 11
Views: 388
Posted By Cache
Re: Memory Leaks

RAII (http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) is a common resource management idiom used in C++. Smart pointers...
Forum: C++ Jun 14th, 2008, 4:23 PM
Replies: 4
Views: 247
Posted By Cache
Re: Assigning a class function as a callback function

The member function would have to be declared static
Forum: Coder's Corner Lounge May 15th, 2008, 7:04 PM
Replies: 23
Views: 796
Posted By Cache
Re: Free will or Predestination?

No, I don't think I would. "continuum of individuality ... from lifetime to lifetime" - all sounds like fluff to me. Metaphorical fluff, of course ;). I don't find that kind of language helpful.

A...
Forum: Coder's Corner Lounge May 15th, 2008, 7:55 AM
Replies: 23
Views: 796
Posted By Cache
Re: Free will or Predestination?

I can't see what logic there is in taking a natural explanation for a physical phenomenon and then saying: "Maybe there's a magic man in there too!"
That seems to me like the kind of thinking that...
Forum: C++ Apr 29th, 2008, 2:58 AM
Replies: 6
Views: 259
Posted By Cache
Re: initilizer incmplete type

You need to:
#include "Scanner.h"
#include "SymTab.h"
#include "FunTab.h"
#include "Store.h"in either Parser.h or main.cpp

#include <cassert> in PTree.h

And there's an error in SymTab.cpp at line...
Forum: Coder's Corner Lounge Apr 1st, 2008, 1:24 PM
Replies: 14
Views: 352
Posted By Cache
Re: Wtf. Gmail Allows You To Set Your Own Email Timestamp?

The best features are always released on April 1st.:P
Forum: Coder's Corner Lounge Mar 4th, 2008, 11:40 AM
Replies: 2
Views: 164
Posted By Cache
Re: Programmingforums on Wikipedia?

Removed for "G11 (http://en.wikipedia.org/wiki/Wikipedia:CSD#G11): Blatant advertising...
Forum: C++ Feb 27th, 2008, 5:43 PM
Replies: 11
Views: 683
Posted By Cache
Re: problems with CopyFileEX

LARGE_INTEGER is a union type. You have to access it's data members which are actually numeric types.

example:
LARGE_INTEGER x, y;
LONGLONG z = (x.QuadPart / y.QuadPart) *...
Forum: C++ Feb 20th, 2008, 2:49 PM
Replies: 2
Views: 134
Posted By Cache
Re: Missing Main In Allegro

Read the Allegro documentation. Some libraries require that 'main' have a specific signature. You may also be required to set the entry point.

If you just want to fumble about try:
int main(int...
Forum: C++ Jan 20th, 2008, 5:56 PM
Replies: 18
Views: 451
Posted By Cache
Re: GetWindowInfo -

Sane, the code below is broken. Due to the higher precedence of operator == over operator & your code actually evaluates to (x & (y == y)). I think your intention was ((x & y) == y). This goes for...
Forum: C++ Jan 19th, 2008, 5:28 PM
Replies: 22
Views: 530
Posted By Cache
Re: Exception handling: point is...?

Channel 9 did an interview with Ale Contenti on exception handling. People here might find it interesting.

Understanding Exceptions and When/How to Handle...
Forum: Community Announcements and Feedback Oct 17th, 2007, 5:13 PM
Replies: 20
Views: 691
Posted By Cache
...or perhaps DaWei's been at the sacrificial...

...or perhaps DaWei's been at the sacrificial chickens again!?
Forum: C++ Sep 16th, 2007, 2:59 PM
Replies: 6
Views: 281
Posted By Cache
Proposal for C++0x Delegating...

Proposal for C++0x Delegating Constructors:
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2006/n1986.pdf (pdf)

You might find that interesting. I wouldn't take it as a justification for your...
Forum: C++ Sep 5th, 2007, 5:48 PM
Replies: 2
Views: 902
Posted By Cache
If I'm looking at the right control, then I think...

If I'm looking at the right control, then I think it's: BS_GROUPBOX
Forum: C++ Sep 5th, 2007, 2:33 PM
Replies: 6
Views: 217
Posted By Cache
Works in VC8 (MSVC 2005) with no errors. Perhaps...

Works in VC8 (MSVC 2005) with no errors. Perhaps the 'once' pragma is meaningless in your environment? BTW, C++ doesn't require a semicolon to terminate a namespace.
Forum: C++ Aug 21st, 2007, 4:44 AM
Replies: 1
Views: 201
Posted By Cache
Then hold your pants...

Then hold your pants on:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1758.pdf
Forum: Coder's Corner Lounge Aug 5th, 2007, 7:37 AM
Replies: 91
Views: 1,793
Posted By Cache
This is only somewhat related to the subject...

This is only somewhat related to the subject matter, but hey. Just the other day on Digg I saw someone suggesting that they would like to see NBC "To catch a predator" go after bloodninja. I guess...
Forum: C++ Jul 4th, 2007, 6:18 PM
Replies: 8
Views: 185
Posted By Cache
It still wouldn't have external linkage.

It still wouldn't have external linkage.
Forum: C++ Jul 4th, 2007, 1:34 PM
Replies: 8
Views: 185
Posted By Cache
I think pointer template arguments have to have...

I think pointer template arguments have to have external linkage. Presumably '0' doesn't. You'll have to do some digging.
Forum: C++ Jun 7th, 2007, 9:50 AM
Replies: 6
Views: 175
Posted By Cache
or, using the tools already provided by the...

or, using the tools already provided by the standard:

#include <cctype>
#include <string>
#include <algorithm>

// ...

std::string str = "ABCDE";
std::transform(str.begin(), str.end(), str.begin(),...
Forum: C++ Jun 6th, 2007, 10:14 PM
Replies: 11
Views: 226
Posted By Cache
Nope. It compares the length of the string one...

Nope. It compares the length of the string one element past the element used for input in the current iteration.

This is because you use post increment inside the subscript operator:
cin >>...
Forum: C++ Jun 6th, 2007, 9:39 AM
Replies: 6
Views: 184
Posted By Cache
The threading API you're using probably has some...

The threading API you're using probably has some form of an atomic add function.
Forum: C++ May 16th, 2007, 11:27 AM
Replies: 16
Views: 223
Posted By Cache
Learn about iterator categories. You shouldn't...

Learn about iterator categories. You shouldn't have any problem implementing an iterator once you've figured out what requirements it should satisfy.
Forum: C++ Mar 29th, 2007, 10:37 AM
Replies: 12
Views: 245
Posted By Cache
You might check out OpenMP. From the...

You might check out OpenMP.

From the page:


http://www.openmp.org/drupal/
Forum: C++ Mar 29th, 2007, 7:50 AM
Replies: 13
Views: 253
Posted By Cache
Calling the function 'saidsfunc' via...

Calling the function 'saidsfunc' via 'saidsfunc(1)' would work if 'i' was declared const int&.

int main()
{
int& a = 1; // error: initializer for T& must be lvalue of type T
const int& b...
Forum: C++ Mar 4th, 2007, 3:33 PM
Replies: 11
Views: 328
Posted By Cache
The only difference in setting...

The only difference in setting _CRTDBG_LEAK_CHECK_DF through _CrtSetDbgFlag is _CrtDumpMemoryLeaks will be called automatically when the program exits. I don't know why you're getting different...
Forum: C++ Mar 4th, 2007, 10:00 AM
Replies: 11
Views: 328
Posted By Cache
You can use _crtBreakAlloc to break at the...

You can use _crtBreakAlloc to break at the allocation site (allocation number 151 from the above dump). Then just follow the stack out of all the debug nonsense back to your offending code.

Small...
Forum: Coder's Corner Lounge Jan 14th, 2007, 11:39 AM
Replies: 2
Views: 198
Posted By Cache
See the remarks section of the following...

See the remarks section of the following link:

http://msdn2.microsoft.com/en-us/library/aa364583.aspx
Forum: C++ Jan 13th, 2007, 4:54 PM
Replies: 11
Views: 309
Posted By Cache
The book "C++ Coding Standards: 101 Rules,...

The book "C++ Coding Standards: 101 Rules, Guidelines, and Best Practices" is more likely your best bet.

http://www.amazon.com/C++-Coding-Standards-Guidelines-Depth/dp/0321113586
Forum: C++ Nov 17th, 2006, 7:44 AM
Replies: 2
Views: 197
Posted By Cache
The signature of the prototype is different from...

The signature of the prototype is different from the definition.


void draw_display(char number[7], int size); // Prototype sig.
//...
void draw_display(char number[7], unsigned int size) //...
Forum: C++ Nov 8th, 2006, 12:59 PM
Replies: 4
Views: 216
Posted By Cache
The "odd corners " are explained in "The C++...

The "odd corners " are explained in "The C++ Standard Library: A Tutorial and Reference". Specifically chapter 13.8 and the whole of chapter 14 in this...
Forum: C Oct 26th, 2006, 2:17 AM
Replies: 4
Views: 231
Posted By Cache
Breaking it down into logical steps should help....

Breaking it down into logical steps should help. Such as the following (untested) example:

case ID_DOES_EXIST:
{
char exists[80];

const char* vPlayer = "Viewpoint...
Forum: C++ Oct 24th, 2006, 8:04 AM
Replies: 5
Views: 218
Posted By Cache
Just thought, SingletonHolders creation policy is...

Just thought, SingletonHolders creation policy is a template parameter. I could just define my own in the namespace Screen lives in. But then I'd be duplicating code. Any thoughts?
Forum: C++ Oct 24th, 2006, 6:31 AM
Replies: 5
Views: 218
Posted By Cache
Shockin'. Looks like it's time to go through "The...

Shockin'. Looks like it's time to go through "The Complete Guide" again.



Breaking the "rough rule" in this case might be a necessary evil. In my actual code I'm using Loki's 'SingletonHolder'...
Forum: C++ Oct 24th, 2006, 2:13 AM
Replies: 5
Views: 218
Posted By Cache
Inter-namespace template friends (VC++ 2005)

The following code gives the error: when complied with VC++ 2005. The exact some code complies with 0 errors and 0 warnings with g++ (not sure of the version).

Have I hit a VC++ standards...
Forum: C++ Oct 17th, 2006, 9:53 PM
Replies: 13
Views: 243
Posted By Cache
std::vector also has the range checked 'at'...

std::vector also has the range checked 'at' member to access elements. It will throw an exception instead of overrunning if the index is out of range.
Forum: C++ Oct 17th, 2006, 4:44 PM
Replies: 10
Views: 243
Posted By Cache
You might want to look up std::map which let's...

You might want to look up std::map which let's you do things such as:

#include <string>
#include <map>

enum sKind_t {
S_BLUE,
S_GREEN,
S_YELLOW
};
Forum: C++ Oct 14th, 2006, 1:57 PM
Replies: 7
Views: 174
Posted By Cache
Also, having non-inline member function...

Also, having non-inline member function definitions in the header file can causes linker errors in VC++. Not sure if it does in other implementations.
Forum: C++ Oct 12th, 2006, 6:56 PM
Replies: 12
Views: 374
Posted By Cache
You should check out SDL. It's an easy to use...

You should check out SDL. It's an easy to use "Multimedia library" (with excellent docs) for making 2D games. I'm currently making a signal/slot based C++ wrapper for it. There are already a few...
Showing results 1 to 40 of 285

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC