@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8



Comments:

<0> heh
<0> yea, thats true ;p
<1> unless the spam bots are getting more sophisticated
<1> where they ask a question relevant to the channels they join
<1> heh
<2> sure. but what if there was an answer from a nick of that format? ;-)
<0> it's all a hoax
<1> heh
<0> the matrix has you
<1> ****ing wind, i must say
<1> it looks like my roof repairs have been redamaged
<2> haha
<1> worst windy winter ever
<1> this is at least the twelth tiime of 40+ mph gusts
<1> some days 50+
<0> wow



<0> where are you again?
<1> virginia, at the foot of the "mountains"
<0> ah
<1> (after being on the west coast, anything less than 10,000 ft high is not a mountain)
<0> hehe yeah i bet
<2> so why does a function like f(int a[5]) gets called with a reference instead of by value? at least to my understanding, it would be possible to put the 5 ints onto the stack
<2> and please...i'm not a bot. really. i swear.
<3> but you are a dude :))
<4> melissa18: This is a lie.
<5> A C array is a const pointer by definition.
<5> With a sequence of memory pre allocated according to its declared length.
<5> If you p*** your array like func(*a) you'll be p***ing the value of the first element of your array.
<5> umm.. that wouldn't be p***ing an array anymore.
<2> why was C designed like this?
<0> C didn't have references in the early days, I think
<2> at least for me, it's not intuitive that arrays of static sizes are p***ed as pointers.
<0> and I don't think structs were able to be copied - so you always p***ed them as a pointer, too
<5> No it didn't
<5> It was added later
<0> melissa18 lots of us don't think C was very intuitive. that's why we prefer C++
<5> All depends on what paradigm you have been weened upon.
<2> afaik, references were introduced with c++, since they're just a means to use pointers in an easier way.
<5> Ask a lisp programmer (if one exists anymore) and he wouldn't understand c#
<6> references make operator overloading possible
<1> void foo(int a[5]); /* p*** by pointer semantic */ int a[5]; int b[10]; int c; foo(a); foo(b); foo(&c); are all valid calls
<0> in C, you mean?
<1> in C++
<2> at least the first 2 ones work in C++.
<2> the 3rd, i'm not sure.
<6> void f( int a[] ) is identical to void f( int* a )
<1> correct
<6> however, arrays are not identical to const pointers, even in C
<5> Kniht whats the difference?
<6> and arrays aren't first cl*** objects, so that's why you can't p*** them on the stack, melissa18
<6> IRR^: the type
<5> Whats their type?
<5> In pointer syntax
<6> arrays have an array type
<6> I don't see what you're asking
<5> blee heee
<0> *shrug* just use vectors and be on your way
<5> vectors in C? :)
<0> no, don't use C either
<2> rdragon: i use vectors in all cases where i can without too much overhead.
<5> By that logic don't use C++ either either
<0> when would there be too much overhead?
<5> Use C"
<2> but there are still some cases, where an array is just the better choice.
<5> C# even
<0> melissa18 - when?
<5> Freshmen homework ***ignments
<1> on a cleared list, _m_?
<2> if you want to buffer points, and you want to have buffers for points in 3-space, in 4-space and 5-space.
<7> no, leet regex fu.
<5> ...
<0> melissa18 - I don't follow...
<4> The difference is that sizeof(int*) == 4 (say), while sizeof(int [10]) == 40. Therefore, if you have: int a[3][10]; int (*p)[10] = a[1]; Then you can do: ++p and it will skip to the start of a[2].
<5> rdragon its a dead end. There is nothing to follow.
<2> and you want to perform dimension-independent operations on the buffers, then you probably use a template cl*** for the buffer.



<0> melissa18 the discussion was array vs vector
<2> yes still there.
<5> Run there is a symantic difference, not a syntactic difference.
<5> Ofcourse physics majors aren't sophisticated enough to figure that out.
<6> IRR^: 'semantic', and if [] instead of * isn't a syntactic difference, what is?
<2> ok i'll try to distill out the important part.
<4> IRR^: The behaviour of code change if you change a type from int[10] to int*, some code won't even compile anymore.
<5> Kniht you can perform pointer arithmetic on arrays. Its interchangeable.
<5> Unless you haven't read any basic text in C
<6> that doesn't mean they're identical
<5> or C++
<5> They are syntactically equivalent.
<2> if you have a lot of arrays (or vectors) of small sizes, let's say size 3. then the vectors need more memory than arrays.
<5> melissa18 and you are running an x86 at your home?
<6> melissa18: they don't require any more memory than dynamic arrays
<5> Umm.. 8086
<5> With a 64K memory limit
<2> no, just working on a 36MPx real-time VR system.
<0> why do you have tons (millions? billions?) of arrays of only size 3?
<0> and each array has its own name?
<2> Kniht: and compared to static arrays? and don't vectors also use dynamic arrays inside??
<0> if you're storing x,y,z points in an "array of size 3", then certainly that's no good. vector<Point3d>
<6> melissa18: 'static array' is a misnomer. they solve a different problem than fixed-size arrays do
<2> rdragon: what i'd really +like+ to have is something like a vector<float[3]>
<0> why?
<6> melissa18: but if you want a first-cl*** fixed-size array, you can use boost::array, or similar, which also doesn't have heap allocation
<0> what does that float[3] represent?
<2> Kniht: ok, it was fixed-size arrays what i wanted to say
<6> vector< boost::array<float,3> >
<0> struct Point3d{ float x; float x; float z; }; //much better
<6> I believe
<2> rdragon: a float array of size 3
<6> but rdragon is right
<6> except for misspelling 'y' :P
<0> yea ;p
<2> rdragon: ok yes, but i have such things for size 3 and 4 and eventually size 16.
<0> wonderful
<0> this still doesn't make arrays win over vectors
<2> i don't want to use vector< vector<float> >
<0> I never said you should
<6> if you really need a fixed-size array, you can use a fixed-size array type ('normal' array, boost::array, carray, etc.), if you really need a point specified by 3 numbers, then a point type is usually better
<2> and can't use vector< Point3d >
<0> use boost::array, then
<2> maybe that's what i'm looking for.
<6> why can't you use vector<Point3d>?
<2> i'll google for what boost is.
<1> tr1::array
<6> boost = www.boost.org, the best C++ extension library out there. For very boost specific questions, also visit #boost
<1> favor the tr1 versions of the boost libraries, if possible
<0> ohh, hm
<0> thanks peterhu, i didn't realize they split things off into a tr1 library
<0> i thought people were just renaming the namespace to tr1
<6> tr1 is from the iso committee
<7> (from the LWG of the committee)
<0> er, hmm
<0> there is no boost/tr1 directory in 1.33.1
<7> that's correct.
<7> 1.33 predates tr1
<0> so where is it, in a dev release?
<2> ok thanks. i didn't know boost. boost::array ist exactly what i was looking for.
<0> sure it is
<2> and for some of you, i'd like to quote a part of the doc on boost::array:
<2> "std::vector<> provides the semantics of dynamic arrays. Thus, it manages data to be able to change the number of elements. This results in some overhead in case only arrays with static size are needed."
<2> from http://www.boost.org/doc/html/array.html
<0> yeah, you're not reading correctly
<6> what about it?
<7> rdragon: sorry, I don't even know whether it will be released with 1.34.
<0> that's part of the rationale behind why boost::array was created
<7> (I /***ume/ it will be)
<0> _m_ - ah
<1> stlport, dinkumware, and libstdc++ are all working on implementing tr1 support, afaik, too
<0> great :)
<1> going to celebrate my new job tonight with the inlaws, nice fancy french place
<1> foooood


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

#teens
#linux
#AllNiteCafe
#AllNiteCafe
#linuxhelp
dev-c++ missing initializer for member
What is the name of the engine developed for the Harrier jump jet
#linux
#windows
okmu heck



Home  |  disclaimer  |  contact  |  submit quotes