Most Interesting Bug Track Down2728 (11/24/2006 10:12:15 PM) comp.lang.c I thought it might be interesting to share experiences of tracking down a subtle or mysterious bug. I myself haven't much experience with tracking down bugs, but there's one in particular which comes to mind... Frederick
Intrinsic Array as a Container1624 (11/22/2006 2:44:47 PM) comp.lang.c++ Inspired by page 219 of Nicolai M. Josuttis's book, I set out to write a class for an intrinsic array which would behave, to as far an extent as possible, like a container. Also though, I wanted no overhead ... Frederick
"Might be undefined" Behaviour2636 (11/21/2006 9:43:35 PM) comp.lang.c I have a general idea of the different kinds of behaviour described by the C Standard, such as: (1) Well-defined behaviour: int a = 2, b = 3; int c = a + b; (Jist: The code will work perfectly... Frederick
Oh God not references again...2838 (11/21/2006 1:57:14 PM) comp.lang.c++ When I was a beginner in C++, I struggled with the idea of references. Having learned how to use pointers first, I was hesitant to accept that references just "do their job" and that's it. Just recently, a ... Frederick
Byte Address Arithmetic Debate2424 (11/19/2006 8:05:11 PM) comp.lang.c++ There is a thread currently active on this newsgroup entitled: "how to calculate the difference between 2 addresses ?" The thread deals with calculating the distance, in bytes, between two memory addres... Frederick
Array CopyConstruct as efficiently as possible154 (11/15/2006 11:39:39 AM) comp.lang.c++ If we want to copy an array of POD's, we can simply do: SomePODType src[8] = { ... }, dest[8]; memcpy(&dest,&src,sizeof dest); We can assume that this method is definitely faster than (if not at lea... Frederick
Note to fellow newsgroup posters6035 (11/11/2006 5:22:00 PM) comp.lang.c Hello everyone. I am sorry for my behaviour on this newsgroup. Particularly, I want to apologise to the newsgroup regulars who have put up with my childish behaviour. The truth is, I'm a nineteen year old m... Frederick
Self-assignment -- undefined?1649 (11/9/2006 4:24:24 PM) comp.lang.c Does the following snippet exhibit undefined behaviour (excuse the stupidity of the code): int i = 5; i = i; Or what about a more complex form of it: void Func(int *const p,int const *const q)... Frederick
Worrying Prevalence of K++ Compilers927 (11/8/2006 7:17:34 PM) comp.lang.c++ It seems there's quite a few compilers out there that don't follow the C++ Standard when it comes to default-initialisation. Here's some quick test code if anyone would like to try it out. So far, it seems t... Frederick
Generic Pointer Type335 (11/6/2006 5:22:40 PM) comp.lang.c++ For objects, we have "void*" as the generic pointer type. For instance: enum ParamType { Int, Double }; void Func(void *const p,ParamType const pt) { switch (pt) { case In... Frederick
variable allocated from stack/bss ??11944 (11/29/2006 7:16:46 AM) comp.lang.c Given the following code & variable i . int main(int argc,char **argv){ int i; printf("%d\n",i); return 0; } here i is allocated from bss or stack ? I think it is stack,because it pri... onkar.n.m(70)
How to write a murder-program in C ???2343 (11/30/2006 5:14:49 AM) comp.lang.c I want to write a program that can kill people in C. Something that will display flashing colors or fractal pictures that will overload the brains of my victims so that they die. But, how can I write such a de... spartan_isle(15)
A problem of T * const &933 (11/30/2006 8:33:34 AM) comp.lang.c++ the program is as follows: #include using namespace std; class A{}; int main() { A* const &p =3D NULL; vector B(3,NULL); //there is a compile error B.push_back(NULL); return 0; } int VC7=A3... miaohua1982(23)
C++ style casting524 (11/30/2006 8:07:27 PM) comp.lang.c++ I've always been a little sketchy on the differences between static, dynamic, and reinterpret casting. I am looking to clean up the following block by using C++ casting instead of the C style casting. from what... cpisz(470)
pass by reference336 (11/30/2006 11:37:10 PM) comp.lang.c++ I was just wondering what typically happens under the hood when you pass a C++ variable by reference. It looks like a pointer gets passed in, but the compiler let's you access it as if it wasn't a pointer. An... mike7411(65)
what happened to Dan Pop?935 (12/1/2006 9:39:19 PM) comp.lang.c ??? Not that I miss his posts, but somehow I find sad that somebody disappears from view and nobody gives a damm. Anybody knows what happened to him? He had lost is job, and was looking for a new one last t... jacob(2538)
Local classes in C++?1726 (12/2/2006 11:38:35 AM) comp.lang.c++ I didn't think this was possible in C++. I don't believe Stroustrup mentions this anywhere in TC++PL(SE). I've never seen it used in code that I can recall. Is this feature widely supported? Is it used? #i... chattengau(616)
Calculation of increment operator734 (12/3/2006 3:25:36 AM) comp.lang.c++ Hello, everyone, below is the program to calculate an expression of increment operator, the result j is 4 and i is 8 seems unbelieveable, so what is the rule of such expression? int i , j = 2; i = ++j+(++j); ... laikon(12)