Search:

Type: Posts; User: thumper; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.07 seconds.

  1. Replies
    14
    Views
    789

    Re: Simply Python list question

    My question would be different.

    Why do you think you need a list with 40 zeros in it?
  2. Re: c++ pointers dynamic arrays quick question.

    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...
  3. Replies
    2
    Views
    549

    Re: C++ STL vector: handling an ambiguity

    When evaluating which function to call, a non-template matching function is chosen over any templated function.
  4. Replies
    10
    Views
    1,598

    Re: Storing generic class in a C++ Map

    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...
    ...
  5. Replies
    6
    Views
    1,782

    Re: simple pthread problem c++

    No, that isn't right.


    When it forks yes, with pthreads no.
  6. Replies
    6
    Views
    1,782

    Re: simple pthread problem c++

    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...
  7. Thread: pointers help

    by thumper
    Replies
    1
    Views
    231

    Re: pointers help

    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 &.

    ...
  8. Replies
    2
    Views
    744

    Re: Access CVS repository made in Cervisia

    Oh I forgot...

    #bzr on freenode IRC is where the bazaar devs hang out, and you can always get help there.
  9. Replies
    2
    Views
    744

    Re: Access CVS repository made in Cervisia

    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...
  10. Thread: Learning C++

    by thumper
    Replies
    13
    Views
    810

    Re: Learning C++

    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...
  11. Replies
    5
    Views
    424

    Re: learning more c++

    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...
  12. Replies
    12
    Views
    1,856

    Re: C++ Dynamic Arrays

    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.
  13. Replies
    20
    Views
    178,957

    Re: Convert C++ String to Integer

    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 =...
  14. Replies
    12
    Views
    1,856

    Re: C++ Dynamic Arrays

    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...
  15. Thread: grep nth line

    by thumper
    Replies
    10
    Views
    112,776

    Re: grep nth line

    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
  16. Replies
    21
    Views
    1,160

    Re: What programming language to choose?

    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.
  17. Replies
    21
    Views
    1,160

    Re: What programming language to choose?

    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...
  18. Re: [Questions] how to detect the status of a python thread?

    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...
  19. Replies
    3
    Views
    341

    Re: Coming back to C++`

    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.
  20. Replies
    11
    Views
    812

    Re: C/C++ Standards

    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...
  21. Replies
    5
    Views
    2,885

    Re: help me debug C++ program

    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...
  22. Replies
    5
    Views
    9,081

    Re: Boost Tutorial and Help

    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:

    ...
  23. Replies
    5
    Views
    9,081

    Re: Boost Tutorial and Help

    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.
  24. Replies
    7
    Views
    818

    Re: Improvements on my code? (C++)

    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...
  25. Replies
    7
    Views
    818

    Re: Improvements on my code? (C++)

    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...
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4