Search:

Type: Posts; User: generaltso78

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    2,223

    The strange thing is that 25, 20, 15, 10, 5, 0...

    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...
  2. Replies
    11
    Views
    2,223

    Yes, I was using the step over command within the...

    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...
  3. Replies
    11
    Views
    2,223

    Ok, that makes sense but what is it that makes...

    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...
  4. Replies
    11
    Views
    2,223

    this recursion behavior baffles me

    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) {
    ...
  5. Replies
    5
    Views
    8,790

    Thanks Failure67, I got it to work with this:...

    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)) ;
    }
  6. Replies
    5
    Views
    8,790

    I am getting "a value of type void* cannot be...

    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
  7. Replies
    5
    Views
    8,790

    MSVS has triggered a breakpoint

    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...
  8. Replies
    13
    Views
    1,892

    Thanks all, I want sure what was being conveyed...

    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.
  9. Replies
    13
    Views
    1,892

    I'm sorry guys, I should have mentioned that this...

    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...
  10. Replies
    13
    Views
    1,892

    I am getting: illegal use of this type of...

    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...
  11. Replies
    13
    Views
    1,892

    This is the smallest portion of the above code...

    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...
  12. Replies
    13
    Views
    1,892

    MSVS compiler errors

    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...
  13. Thank You, Andreas

    Thank You, Andreas
  14. Sorry all, I hope this helps. I increment the...

    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...
  15. Anyone have a better way of randomizing groups

    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,...
  16. Replies
    13
    Views
    4,059

    Thanks Barney, my instructor could care less...

    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...
  17. Replies
    13
    Views
    4,059

    As it turns out, everything was written fine for...

    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...
  18. Replies
    13
    Views
    4,059

    Thanks Jim, I cannot tell though if the...

    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...
  19. Replies
    13
    Views
    4,059

    I originally had the fwrite to write each...

    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...
  20. Replies
    13
    Views
    4,059

    I expected that stats[i] would be stats[i].teams,...

    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
  21. Replies
    13
    Views
    4,059

    Thanks, here is the function that implements the...

    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...
  22. Replies
    13
    Views
    4,059

    Am I writing binary data correctly

    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...
  23. Thanks Salem, My assigned book refers to C99...

    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...
  24. Ok, since I cannot use in visual...

    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?
  25. Can someone please take a look and tell me where it all goes wrong

    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....
Results 1 to 25 of 42
Page 1 of 2 1 2