The strange thing is that 25, 20, 15, 10, 5, 0 passed during the recursive calls. The outputs prints out 5, 10, 15, 20, 25. I understand this is due to first in first out on the stack, but I dont...
Type: Posts; User: generaltso78
The strange thing is that 25, 20, 15, 10, 5, 0 passed during the recursive calls. The outputs prints out 5, 10, 15, 20, 25. I understand this is due to first in first out on the stack, but I dont...
Yes, I was using the step over command within the debugger. I did also try to use the step into command when the line being pointed to was a recursive call but never got any different order to the...
Ok, that makes sense but what is it that makes the compiler execute the remaining code 5 times. Is it because each call remains on the stack and that is how it knows how many times to execute...
I have a questions in regards to what is happening to this code wile debugging.
#include <stdio.h>
#include <stdlib.h>
void a(int x){
if (x >= 5) {
...
Thanks Failure67,
I got it to work with this:
board = (char **)calloc (20, sizeof (char* )) ;
for (i=0; i<20; i++) {
board [i] = (char *)calloc (40, sizeof (char)) ;
}
I am getting "a value of type void* cannot be assigned to entity of type char**" with that calloc declaration. Is that because I declared char **board?
Thanks
Hi guys,
We are just learning how to implement calloc, malloc and free. At the end of my program, I keep getting a "windows has triggered a break point" error. Im pretty sure that this error is...
Thanks all, I want sure what was being conveyed when everyone was saying mixed declarations and such. Moving srand underneath the declarations worked. Appreciate the help.
I'm sorry guys, I should have mentioned that this program is being written for school assignment. The instructor has us use MSVS because that is what he uses. That being said, The program compiled...
I am getting:
illegal use of this type of expression, syntax error missing ; and subscript requires an array pointer type for line 19 (WORDS userWords[16])
syntax error missing ; for lines 20...
This is the smallest portion of the above code that compiles in MSVS 12. As soon as I un-comment any of the other three declarations the compiler gives me an error. This is the same code I was...
I am getting some strange compiler errors. I had this code working fine this morning and unless Im losing my marbles, I dont remember changing anything except writing some new functions. I commented...
Thank You, Andreas
Sorry all, I hope this helps. I increment the counter in all my else statements within the switch because I would have to run the loop over a hundred times to make sure I got enough random numbers to...
I have thisassignment and we are to randomly setup groups of 5. There are 22 students(stored in STUDENT struct) and we have to randomly assign them into one of 5groups. group 1 will have 5 students,...
Thanks Barney, my instructor could care less about portability but I do. I know that if I ever plan on pursuing anything beyond writing basic programs for class than I will need to have a better hold...
As it turns out, everything was written fine for how I needed the program to operate.
The problem lied with the fwrite that wrote to the file as soon as the program started. When I commented that...
Thanks Jim,
I cannot tell though if the displayMenu() writes correctly because the showStats() function is just outputting what is stored in memory in the array of structs.
I know I am...
I originally had the fwrite to write each individual element one at a time. This program will never need to read individual elements. My instructor said it would be easier to write and read in one...
I expected that stats[i] would be stats[i].teams, stats[i].wins, stats[i].losses, stats[i].pct, stats[i].runsScoredr and stats[i].runsAgainst.
Thanks,
Michael
Thanks, here is the function that implements the fread portion. I also included the source file, in case anyone wanted to take a further look. As you notice, I did not include a file path but that...
I am having problems either writing data to a binary file or reading from the file. Through the process of elimination I am posting the code where the data is written to file to see if I can...
Thanks Salem, My assigned book refers to C99 concepts even though we are working out of visual studios in class. I figured out that the majority of errors were because I was trying to initialize...
Ok, since I cannot use <stdbool.h> in visual studios, I guess I will have to create a bool type. Does visual studios have any other includes that will work with bool?
I'm trying to run this program and I'm getting about 70 errors starting at line 27 and I only have a little over 60 lines of code. I have run through it a few times and cannot see the fatal flaw....