After weeks of implementing a class which accepts function pointers I found out that passing pointers to member
distance(vec.begin(), it);
even the last line fo the function
http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/commands.c?op=file&rev=0&sc=0
this is the file that i’m having problems with it seems
but it might not originate there
https://alioth.debian.org/frs/download.php/1970/ccid-1.3.0.tar.gz — this is the package
the problem is that it’s hard to test without the reader
Hello, can anybody tell me, why I should prefer this rule?
When advancing iterators and variables prefer ++var to var++.
why is ++var better?
For complex types (like iterators) ++var would normally be faster.
why is that so?
Hello FauxFaux
Because operator++ would be implemented as { T temp = foo; ++foo; return temp; }
++i increments immediately. i++ returns the old value.
With any sane optimizer it’s completely irrelevant, obviously, but.. :p
so than I can allways use ++i in every for loop
but why is that difference?
I mean why did they not implment ++var like var++?
wrong
why not va++ like ++var
Because postfix ++ _must_ return the old value.
Thus, you must store the old one while incrementing.
anyone know of a good chart lib with smooth fancy lines…
postfix is for when you want the old value and increment, and prefix is for when you just want to increment.
I use prefix if I want to increment and have the new value too
Indeed.
okay
good to know
well, the main problem is that I get stack smashing detected
but I have no idea where and why that happens!
how can I find out which line gives the error
debug
I have
I have 20 lines of code
debug more
…
how can I bind all of the IPs my pc has to a socket?
debug++
http://cpp.sourceforge.net/?show=37893
print(some message); run func(); print(another message)
an the second never appears
wait, sorry this is C++ i meant C#
howerver at the bottom of func i have like “….; print(end of func); }”
and end of func gets out
avds, why printf?
stop mixing C and C++ :p
malloc is evil
bushwakko, can you repost the link of the paste of the source?
So are pointers.
actually its two different files though
!qrab GeorgeA
GeorgeA this is a warning shot. You almost got grabbed.
but here goes
p is not initialized, i think
I NEED to mix C and C++ as described in comments — I need to use a C api
that behaves internally like the myalloc
http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/commands.c?op=file&rev=0&sc=0
I can call the ccid_error(…) there
what does that mean almathea?
but not get the thing after it
almathea, why not?
http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ccid.c?op=file&rev=0&sc=0 — this is where ccid_error is from
printf) why not?
!printf
The {,f,s}printf() function family is evil. Use std