Initializers421 (4/19/2010 2:28:19 PM) comp.lang.c++ I'm very confused among different types of initializations: zero-initialize: scalar: set to 0 class/array: initialize recursively union: initialize first member reference: no-op default-initialize: class... Michael
Is allocating large objects on the stack a good practice?1535 (3/16/2010 1:57:42 PM) comp.lang.c For example, if we allocate objects like this: void foo(void) { static const size_t size = 10000000; /* ten million */ int data[size]; /* data is a very large object */ /* do something with data */ } In C9... Michael
How to emluate "properties" in Java?5536 (2/25/2010 12:38:01 PM) comp.lang.java.programmer -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A property is defined as a member that is read and written like a field, but the read and the write actually calls the getter and setter. http://en.wikipedia.org... Michael
[C++0x] l-values and r-values126 (2/24/2010 8:45:31 AM) comp.lang.c++ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 1. Is the following possible: int a = 3; int && b = a; 2. I want to write the signatures of extractors in this way: #include class foo_t; template std::basic... Michael
PHP 5 object behaviour1924 (2/11/2010 8:15:16 AM) comp.lang.php -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm disappointed by the object handling of PHP 5. In PHP 4, objects were handled like primitive values, assigning an object to a variable causes the object to be... Michael
More support for Paul's array terminology4019 (6/13/2011 1:35:35 PM) comp.lang.c++ To be fair, it just occurred to me, as an example, that we do say "pointer to array of pointers" and not "pointer to first element in an array of pointers". And now I will probably have to kill this thread...... usenet30(677)
Why C++ is vastly superior to C23668 (5/16/2011 3:08:47 PM) comp.lang.c++ Why C++ is vastly superior to C: http://warp.povusers.org/programming/cplusplus_superior_to_c.html "In conclusion, the reason why C is so vastly inferior to C++ as described in this article can be summari... lmc(186)
Coding style for conditionals2820 (4/6/2011 7:05:47 PM) comp.lang.c++ I have no interest in starting a religious war on the subject, but I've been doing some code reviews and running across code like Method 1: int x; if( 0 == ( x = MyFunct() ) ) // do something I personal... jsanga(81)
Is this wrong for C++?29140 (3/23/2011 8:00:41 PM) comp.lang.c++
The array declaration char a[6] requests that space for six characters be
set aside, to be known by the name ``a''. That is, there is a location named
``a'' at which six characters can sit. The pointer de... Paul
changing to C code8122 (2/25/2010 8:23:35 PM) comp.programming I have this C++ code and I was wondering if anyone has any ideas on how
I might change this to C.
/* chunks.cpp
*
* List the majors chunks of a RIFF file
*
*/
#include
typedef unsigned char... Bill
How to emluate "properties" in Java?5536 (2/25/2010 12:38:01 PM) comp.lang.java.programmer -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A property is defined as a member that is read and written like a field, but the read and the write actually calls the getter and setter. http://en.wikipedia.org... miklcct(62)
Scope of a variable declared in for loop7244 (2/23/2010 1:35:28 PM) comp.lang.c Hi, A)Is it possible to declare a variable inside for loop like for(int i=100;i>=0;i--); if yes what is the scope of that variable? B)if there is a for loop like below for(int i=0;int c = getchar();i++... kvvaysage(12)
proper deletion of pointers524 (2/21/2010 3:59:14 PM) comp.lang.c++ Why are you supposed to set a pointer equal to zero after deleting it? At what times are you not supposed to do this? I've been using "delete x; x = 0;" all the time, so often, in fact, that I just put them bot... dwightarmyofchampions(33)
why it doesn't work? #3943 (2/15/2010 2:47:06 PM) comp.lang.c Guys, Consider the following two files, files test.c and test1.c Contents of test1.c are as follows: --------------------------------------------------- int arr[] = { 0x100, 0x200 }; int main(void) { ... junky_fellow(377)
pointers #192732 (2/10/2010 11:11:14 PM) comp.lang.c Ok concering the first parameter of fread. size_t fread(void *buf..., The address seems to be passed to fread's first parameter a lot. Does it have to be done that way? What I see is fread wanting a ... nospam116(1187)