Turns out it was a pointer issue (which we haven't covered in class yet). I threw in an asterisk and it all worked out. As best as I can tell, it had to do with character array names being...
Type: Posts; User: Theta Zero
Turns out it was a pointer issue (which we haven't covered in class yet). I threw in an asterisk and it all worked out. As best as I can tell, it had to do with character array names being...
larger excerpt of my current code below:
printf("Please input the value of N: ");
scanf("%d", &n);
while(n != 0)// Entry of 0 will quit the program
{
for (i = 0; i < sizeOfLychrelList;...
I apologize, my IDE and copy/paste like to fight with eachother.
n is an input number rather than a character, obtained with
scanf("%d", &n);
lychrels[] is an array of long longs.
Ok, I can't figure this out for the life of me.
for (i = 0; i < sizeOfLychrelList; i++)
{
if (lychrels[i] == n)
{
isLychrel = true;
}
That &n fixed 90% of my problems. I also fixed the rest of the issues for good programming form, although admittedly my for loops were due to poor note-taking. All that's left is to sort out my...
Debugging manually lead me to question this:
printf("Please input the value of N: ");
scanf("%d", n);
printf(n);
Commenting out all the rest of the code (except functions) after causes it...
hate to do it, but bump over the wall of spam.
Thought it might be a problem with datatype size (are ints in C really THAT much smaller than in Java? Wow.) so I changed every reference to numbers used for calculation, return types, and basically...
Introduction:
Before I get started, this is an advance warning that I've never coded in C before. I've taken 2 years of java-related programming, but C is a brand new animal for me. This is for a...