My question would be different.
Why do you think you need a list with 40 zeros in it?
Type: Posts; User: thumper; Keyword(s):
My question would be different.
Why do you think you need a list with 40 zeros in it?
Not really.
Don't do that. Since you are using C++, use std::string and std::vector.
None of the contents of a pointer are copied when assigning pointers. What you are doing is...
When evaluating which function to call, a non-template matching function is chosen over any templated function.
Have a look at boost::any or boost::variant to store different types in a map www.boost.org.
Also this line doesn't compile:
typedef std::map<foo, bar<another>> baz;
But this one does...
...
No, that isn't right.
When it forks yes, with pthreads no.
Any variables that you have declared normally are available for both threads.
However you need to be concerned about variables changing state in one thread and being read from another as there is...
My first observation is that you shouldn't be storing raw pointers in a vector. Use a shared pointer instead.
Secondly, passing a vector in by reference can be done with the &.
...
Oh I forgot...
#bzr on freenode IRC is where the bazaar devs hang out, and you can always get help there.
Man, still using CVS?
Try Bazaar (www.bazaar-vcs.org). There are tools even (I think) that will allow you to keep the version history.
However if that isn't that important to you then "apt-get...
Hi William,
I'd suggest joining ACCU (www.accu.org) and then ask on their programming question mailing list.
ACCU does have a general mailing list that you don't need to be a member of to join...
Don't use C++ to program in .NET. C++/CLI is an abomination (sorry Herb).
To program in C++ on ubuntu you need to install the build-essential package, then use g++ as the compiler.
If you are...
The only reason why I can think you'd want to implement a list these days is as part of a learning exercise.
std::list would be the standard way to use a list these days.
Personally these days I use boost::lexical_cast.
#include <boost/lexcal_cast.hpp>
// ...
int i = 42;
std::string s = boost::lexical_cast<std::string>(i);
int j =...
No they don't.
C++ vectors are often used because of the contiguous memory assertion, so the contents of the vector can be used to communicate with C APIs.
Sure you can insert into a list in...
There are these wonderful inventions called pipes.
To grep the 45th line of file foo.txt for "hello"
$ head -45 foo.txt | tail -1 | grep hello
www.python.org is the central place for all things pythonic.
I installed the python docs and refer to those through a bookmark. They are very good.
I also suggest starting with python.
I wish I had known about it earlier. I've been using python for around six years now and it really is great. Most of that was part time along side my primary...
From a quick read of the docs it seems like you can't.
However check out the threading module, and specifically the Thread object. You'll probably find that this gives you the functinality that...
Yes, and so are most books pre-1998. C++ was accepted as an ISO standard around this time, and everything prior to that is most likely wrong, out dated or both.
C99 refers to the ISO C standard that was ratified in 1999. The C++ standard was ratified in 1997 I think, with the next C++ standard due for a vote in 2009.
C and C++ are very different...
C'mon what were you expecting?
Not only did it tell you what the problem was, but the line and character number too.
Just wait until you try to understand the compile errors for templated...
The syntax for program options takes advantage of the wonders of C++ operator overloading and returning references.
Without actually reading the code, they are probably doing something like:
...
The link you need to follow is this one: http://boost.org/doc/html/program_options/tutorial.html
If you have any particular questions, feel free to ping me on freenode.
Could you explain why. Also how would i go about doing that?[/quote]
Ok, firstly what are you using the headers for?
The reason that they start with 'c' is that they are C header files that...
Could you explain this more[/quote]
If it is purely your own code, then fine. Although they are still a pain to enforce.
The problem comes more when calling into other APIs where you don't...