Search:

Type: Posts; User: knirirr

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Replies
    7
    Views
    3,406

    Indeed - most useful, thanks. With the exception...

    Indeed - most useful, thanks.
    With the exception of "hello world" &c. this was the first C program I wrote, and I still don't fully understand pointers, so I would expect it to contain various...
  2. Replies
    7
    Views
    3,406

    I thought that I had done that, but evidently not...

    I thought that I had done that, but evidently not properly.



    Indeed so.
    In case anyone is willing to look at my awful code and indicate the main fault(s) I've put it here. N.B. I would...
  3. Replies
    7
    Views
    3,406

    Removing the call to zipcheck seems to work,...

    Removing the call to zipcheck seems to work, though it's not clear how I can fix things and keep that in.



    static int zipcheck (const struct dirent *dir)
    {
    if (0 ==...
  4. Replies
    7
    Views
    3,406

    Scandir segfault

    I have a program that reads directories and assembles a file describing the data within - the purpose is to create a list of files on a server so that these can be entered into a database to keep...
  5. Replies
    5
    Views
    4,348

    Edit: Found it - there was indeed a bug...

    Edit:

    Found it - there was indeed a bug elsewhere that was setting that value to null before I tried to copy it.
    Thanks!
  6. Replies
    5
    Views
    4,348

    Unfortunately I can't persuade Dev-C++ to show me...

    Unfortunately I can't persuade Dev-C++ to show me the contents of that variable. When the crash occurs, "Microsoft Development Environment" can be called up to tell me the following:



    Unhandled...
  7. Replies
    5
    Views
    4,348

    Strange strcpy crash

    I've been porting a Linux/Mac command-line application to Windows XP using Dev-C++. It's all working other than one particular part where command line arguments are copied to strings. The command...
  8. Replies
    12
    Views
    3,241

    A good point - now corrected, thanks.

    A good point - now corrected, thanks.
  9. Replies
    15
    Views
    2,412

    I'm using strlen() now, thanks. The reason I...

    I'm using strlen() now, thanks.
    The reason I posted it here is that I'm obliged to compile what I'm doing as C++ (other work-related requirements) even though I know even less C++ than I do C (which...
  10. Replies
    15
    Views
    2,412

    D'oh! Thanks - other suggestions incorporated as...

    D'oh!
    Thanks - other suggestions incorporated as well, and it is running nicely.
  11. Replies
    15
    Views
    2,412

    Trimming end of string

    This rather small problem is proving a bit of a nuisance. I have a string that looks like this:


    a_long_string_with_lots_of_underscores


    I need to trim off the final "_underscores", and so...
  12. Replies
    12
    Views
    3,241

    Thanks - that now works. Perhaps if I had tried...

    Thanks - that now works. Perhaps if I had tried learning C before scripting languages this might be rather less confusing...
  13. Replies
    12
    Views
    3,241

    Would you mind telling me the syntax for either...

    Would you mind telling me the syntax for either of these methods, or where I might find information on it? I am not having any success with what I think it should be (e.g. (Experiment)* malloc...).
  14. Replies
    12
    Views
    3,241

    Thanks. I have been compiling it as C++ and it...

    Thanks.
    I have been compiling it as C++ and it tells me that at the "malloc" line that I'm trying an invalid conversion from 'void*' to 'experiment*'. What could be causing that?
  15. Replies
    12
    Views
    3,241

    Creating array of structs

    I'm having some trouble using an array of structs. I need to allocate sufficient memory then pass a pointer to this to a function that will create the array of structs, so that I can use the pointer...
  16. Replies
    3
    Views
    5,268

    Thanks for the suggestions. RAM shouldn't be a...

    Thanks for the suggestions.
    RAM shouldn't be a problem here as the database server has 32GB of it and the strings come from a 2GB file. There will be quite a lot of duplicates, so presumably the...
  17. Replies
    3
    Views
    5,268

    Finding unique strings in an array

    There's a Perl technique I often find myself using for finding unique strings in an array that involves using a hash to keep track of which strings have already been processed. It goes something like...
  18. Replies
    14
    Views
    3,117

    Strangely I can't get it to run unless I use the...

    Strangely I can't get it to run unless I use the specific allocation.
  19. Replies
    14
    Views
    3,117

    I tried replacing the explicit memory allocation...

    I tried replacing the explicit memory allocation with the:



    regex_t * myregex = { 0 };


    ...and though it compiled I got a segmentation fault when I ran it. However, it works as required...
  20. Replies
    14
    Views
    3,117

    Great - thanks once more.

    Great - thanks once more.
  21. Replies
    14
    Views
    3,117

    Thanks again. I did, of course, mean "get around"...

    Thanks again. I did, of course, mean "get around" in the sense of "not having to do it myself."
    I should also have asked why this variable is apparently assigned as an array rather than:


    ...
  22. Replies
    14
    Views
    3,117

    Thanks for the suggestions. I am reminded that I...

    Thanks for the suggestions. I am reminded that I ought to take another look at bitwise operators.
    Just one more question:



    regex_t myregex = { 0 };


    Why does this get around the need to...
  23. Replies
    14
    Views
    3,117

    Thanks for the suggestions. Though still...

    Thanks for the suggestions.
    Though still confused by pointers, I seem to have got it working thus:



    static int check (const struct dirent *regcheck)
    {
    int rc;
    regex_t * myregex =...
  24. Replies
    14
    Views
    3,117

    Listing specific files in a directory

    The GNU site has some example code for listing directory files, found here. According to the documentation, the scandir function allows the user to specify a function with which directory entires...
  25. Replies
    14
    Views
    25,287

    D'oh! Yes, I completely forgot to do that....

    D'oh!
    Yes, I completely forgot to do that. Thanks.
Results 1 to 25 of 27
Page 1 of 2 1 2