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...
Type: Posts; User: knirirr
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...
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...
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 ==...
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...
Edit:
Found it - there was indeed a bug elsewhere that was setting that value to null before I tried to copy it.
Thanks!
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...
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...
A good point - now corrected, thanks.
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...
D'oh!
Thanks - other suggestions incorporated as well, and it is running nicely.
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...
Thanks - that now works. Perhaps if I had tried learning C before scripting languages this might be rather less confusing...
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...).
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?
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...
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...
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...
Strangely I can't get it to run unless I use the specific 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...
Great - thanks once more.
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:
...
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...
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 =...
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...
D'oh!
Yes, I completely forgot to do that. Thanks.