macro definition for different compile configurations1350 (3/27/2012 7:29:11 AM) comp.lang.c++ Hi, I'm stucked by something appears really simple at first sight. I have a function definition with different parameter list in different compile configurations. for example. -------------------------- CON... thomas
Reading C++ ISO Standard1138 (9/4/2011 10:25:32 PM) comp.lang.c++ Hi experts, I find the C++ language complex although I already have a lot of experience on it. So I turned to the C++ standard trying to figure out the details behind. But the standard is more than 700 pages w... thomas
global variable usage for dll1023 (9/3/2011 12:03:36 PM) comp.lang.c++ in Exe. ---------------- Type* g_pGlobal; func(){ g_pGlobal->doSth(); } --------------- in another dll --------------- func2(){ func() } ------------- It compiles ok, but "g_pGlobal" equals 0x000000 w... thomas
How to call back?129 (5/12/2011 2:43:01 AM) comp.lang.c++ Hi guys, ------------------------------------------------------------------ struct Item{ int i; }; class Child(){ void dosth(){ for (int i = 0; i VecItem; Child* pChild; }; ----... thomas
"delete this" for object in Stack4118 (10/15/2010 4:22:48 AM) comp.lang.c++ Hi,
------------
class A {
public:
~A(){}
void Release(){ delete this; }
};
-----------
A *a = new A();
a->Release(); --> Method I
A a2;
a2.Release(); --> Method II
-... thomas
What's the "%02X" specifier doing?3426 (9/5/2010 5:25:35 AM) comp.lang.c++ Hi,
----------code----
int main(){
char Md5Str[34] = "670B14728AD9902AECBA32E22FA4F6BDx";
char Md5Value[1];
sscanf(Md5Str, "%02X", &Md5Value[0]);
}
--------------------
It gives me "run-time chec... thomas
How to elegantly get the enum code from its string type103199 (4/13/2010 9:53:56 AM) comp.lang.c++ Hi guys,
I got a problem in practice, and I cannot find a verly elegant
solution to it.
------------------------------------------------------------------------
enum Type{
REPLY = 100,
... thomas
Serialization in C++2145 (4/9/2010 9:53:03 AM) comp.lang.c++ Hi folks,
Any good suggestions for serialization except those from the FAQ lite?
Do we have any good libraries for that?
Regards,
Tom
... thomas
assigning "const char *" to "char *"8124 (12/2/2009 12:39:57 PM) comp.lang.c++ void doit(const char* p){
char *q = p; //ERROR!
}
char *p = "abc";
-------------------------------------------
I think both and assign "const char *" to... thomas
Segmentation fault in struct234 (11/10/2009 4:46:11 AM) comp.lang.c++ Hello. I am having trouble debugging my code. I have a struct and a function to compute the time difference entered in HH:MM:SS format. My code is: const int hourConv = 3600; // used to get total hours from ... jonwongfanclub(13)
Zero-size array as struct member166231 (8/18/2010 11:30:42 AM) comp.lang.c++ Hi, I need your help.
----------
struct SvrList{
unsigned int uNum;
GameSvr svr[0]; //line A
};
---------
Once I declared a struct like this to store server list info.
It's suppo... thomas
Reading Struct not Located at Four-boundary6688 (8/20/2010 8:33:11 AM) comp.lang.c++ Hi,
I have a struct A(undefined, can be any form) located at memory
pointed by "char *ptr".
I want to read it with "(A*)ptr".
Now I wonder if the position of ptr may affect the behavior when
accessing ... thomas
Sequence point(s)12105 (9/19/2010 8:22:02 AM) comp.lang.c++ Hello,
Consider this piece of code:
int swap(int &x, int &y)
{
y = (x-y) + (x=y);
}
This code "claims" to swap values of x and y. I gather that this
claims holds true only if (x-y) gets evaluated be... Neelesh
Quality of this newsgroup1618 (2/17/2011 4:52:11 PM) comp.lang.c++ The quality of this newsgroup is really poor due to the amount of bullshit posted by trolls of various abilities. Shame. Why do people want to spoil forums such as this? It is irrational; if you want to ha... leigh(1003)
global variable usage for dll1023 (9/3/2011 12:03:36 PM) comp.lang.c++ in Exe. ---------------- Type* g_pGlobal; func(){ g_pGlobal->doSth(); } --------------- in another dll --------------- func2(){ func() } ------------- It compiles ok, but "g_pGlobal" equals 0x000000 w... freshthomas(139)
macro definition for different compile configurations1350 (3/27/2012 7:29:11 AM) comp.lang.c++ Hi, I'm stucked by something appears really simple at first sight. I have a function definition with different parameter list in different compile configurations. for example. -------------------------- CON... freshthomas(139)