Yeah, I understood enough to know what went wrong. I forgot that you don't want to make an array and not define the size of it in C. C is very picky. It's like making a fixed array of say, the size of 3 in Python and then trying to fill it with 4 or 5 items. Python at least tells you that you are trying to put too much in the array. C will not. It will just put garbage in the array. C is hard to debug because of all that. I didn't use C++ (I think there are more descriptive error messages in that). I figured what I'm doing was simple enough for the command line and thus used plain C. I haven't used C or C++ in *ages* so I kinda forgot things!
Also, the function was a little complicated to understand but I got the gist of it. The hardest part was figuring how to get the data in because it's complicated how it goes in. I found code on the web that did that but I still had trouble getting it to work. Luckily the only problem was the array thing.
I'm very good with perl. I need to get better with Python (which I'm doing that by playing around with Python and QT4 on my off time when I can as part of working on the DDM) and I want to get good at C/C++
You know the saying "use it or lose it"!
So I will need to do more projects with these languages!