Thread: searching for c code

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    82

    searching for c code

    Bit embarrassed about this trivial question, but actually I think it's _deceptively_ trivial and it's about how to conduct google searches for specifically c code.

    I do this when starting to code an algorithm and want to see if any work has been done on it. so I type "c code catalan numbers" for example, into "the" google when looking for code on generating catalan numbers (which is an example).

    Of course the chief problem is that "c" could be an initial, or a bunch of other things, so the results can be multifarious and often there's no c at all.

    Programmers in Haskell probably don't have this problem, but equally, there has got to be considerably more c code out there than Haskell.

    Of course, there are a few site one can visit, which usually have some c code, but I was looking for wider, more effective ways of searching for c.

    There are other options for searching for language-agnostic code: so google code, pastebins, github and the like, have a bunch of code, but in these cases, you end up with a bunch of c++, python, Haskell, etc. which in my example, probably have a blackbox function called generate_catalan_numbers() already implemented (i'm being facetious).

    And there is the option of going to open-sourced specialist libraries, many of whihc are in c, and digging out the code. This is actually the option that I usually take. However, this post was about using general internet searches to uncover specific c snippets rather than this targetted approach.

    Anybody any advice on this? I mean, above and beyond "don't do it" (which is true because often, I throw it away after goign through it and start from scratch, but at least I can say I'm not reinventing the wheel).

    Cheers!

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Try C program Catalan numbers or C code Catalan number, or even C language Catalan numbers. Also, try the reverse:
    Catalan numbers C program, etc.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    82
    Thanks Adak for the comment.

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    I'd even consider searching for C++ code rather than C. Google understands what C++ means.
    Whilst you might end up finding C++ code, you'll often find plain C code as well, or at least you are likely to be able to port it.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Searching a BST help
    By MasterAchilles in forum C Programming
    Replies: 3
    Last Post: 04-18-2008, 05:08 PM
  2. Searching for C/C++ code?
    By cpjust in forum C Programming
    Replies: 5
    Last Post: 04-13-2008, 02:21 AM
  3. Searching recursive(with code)
    By johny145 in forum Windows Programming
    Replies: 0
    Last Post: 06-16-2005, 11:08 AM
  4. Please Help with Searching
    By 1999grandamse in forum C++ Programming
    Replies: 5
    Last Post: 11-29-2002, 06:10 PM
  5. searching ><
    By hyaline in forum C Programming
    Replies: 1
    Last Post: 09-16-2001, 05:29 AM