I just figured it out.
The !isalpha line at the beginning of the code was ignoring all hyphens at the start of strings, so I wasn't even picking those up in the program.
This has since been...
Type: Posts; User: DonFord81
I just figured it out.
The !isalpha line at the beginning of the code was ignoring all hyphens at the start of strings, so I wasn't even picking those up in the program.
This has since been...
In this code, the integer "m" is supposed to be counting the number of times the program encounters a value less than zero (I'm measuring rainfall; -999.99 is "missing data"), while "n" is supposed...
Yes. I use "unnecessary" parentheses to keep myself straight. Not for the program.
At any rate, I've also noticed that when I increase LOWER to 5 and UPPER to 45, the array zeroes out as well,...
I'm currently in the process of writing a fairly complex program that iterates through a bit array, testing to see if certain combinations of bits are turned on or off. Up until I added the code for...
Does that mean I have to write a routine to have the program figure out what "*.txt" means?
My main question is: if I use "*.txt" as argv[1], will the program (when it functions correctly) go through all .txt files?
Incidentally, this is the first argc/argv program I've written. It worked when I handled each file separately, so I think I got overconfident. *snicker*
cas was right. I've moved:
double values = number_of_values;
double y[number_of_values];
right after the while loop, so it now reads:
Ideally, I would like to be able to tell my program "autocorrelation *.txt" in a directory and have it process each file in the directory, returning each file's results to a new file ending in...
I still don't know what the program is doing wrong. I thought it might be something along the lines of having forgotten to run "make_matrix" after every instance of changing U_array, but I've...
The function that's probably missing for you is <combination.h>, which is not standard in the C library. I can include the code snippet I used for it, since I found it on an internet forum for such...
Anyone?
Okay ... *sigh*...
I've overhauled the program after writing out, in English, what I ideally want the program to do. Here's the "English" version of the program:
zero all arrays;
create...
You're right! That's a pretty big problem there...
I'm dedicating today to finishing this. And after explaining what I actually want the program to be doing to my professor last night, I think...
Well, I changed the code, and in the interest of keeping my promise, I'm just re-posting to this note.
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <limits.h> /* for...
I feel stupid. I wasn't incrementing the matrix if no solution was found...
Back to the drawing board, I suppose.
Well, I moved combination.h so that it's in the standard directory now.
Okay. I ran this program with MAX = 6, LOWER = 3, and it ran just fine. However, when I tried to bump LOWER up to 4 (and made all the appropriate hard-code changes), the program just loves to crash...
Including the "=" in "if (j > n)" solved the problem with the matrix.
My new question is: how would I go about using XOR? Wouldn't I have to make an entire array of 1's to do (bitarray ^ 1), or...
Thank you! I'll try them...
I probably shouldn't have included the main bitarray or main U_array, as they are not called in the test code.
test_array is the test version of U_array, and test_matrix is the test version of...
The test_array only creates the "upper" or "U" part of the matrix. The matrix itself should be symmetric along the diagonal (entry[i][j] == entry[j][i]), and since I want the diagonal to be all 1's,...
Here's my code. It's supposed to take an array of bits (size MAX, whatever I want MAX to be) and arrange them into a MAX-by-MAX two-dimensional array for printing to screen. I can't tell which of...
That did it! Thanks!
So, something more along the lines of this:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char *argv[]){