Search:

Type: Posts; User: jwall

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    7,580

    Simpletron exercise

    This works, but the next step of modifications are giving me some problems.

    a) Allow the simulator to perform remainder calculations. This requires an additional Simpletron Machine Language...
  2. Replies
    3
    Views
    765

    randomphoneword.c

    The basic idea of this exercise is to generate words from a user-input, seven-digit number(a phone number). The code runs, but for some reason, I can't get it to print the numbers into the file. ...
  3. Replies
    5
    Views
    751

    Thanks

    Works now. Thanks, but when I try to enter spaces, it messes up the input. Why is that?
  4. Replies
    5
    Views
    751

    File matching mishap!!

    Hi:

    I am learning about random access files. Everything works, except when I go to read the output from the third program, it gives me a bunch of gobbledegook.

    This creates the first random...
  5. Replies
    8
    Views
    2,921

    rcgldr: That was exactly it--I believe I said...

    rcgldr: That was exactly it--I believe I said that in my previous post :). But I would still like to know how to loop through a file without using feof in this program?
  6. Replies
    8
    Views
    2,921

    Stack Smashing is actually a protection mechanism...

    Stack Smashing is actually a protection mechanism used by gcc to detect buffer overflow attacks.
    I got the error because some the input was too big for the array. I should have gotten a...
  7. Replies
    8
    Views
    2,921

    Thanks for the help, but how would I implement ...

    Thanks for the help, but how would I implement


    fgets(buf, sizeof(buf), fp) != NULL

    in this situation, will it stop the stack smashing error?

    BTW I'm on linux
  8. Replies
    8
    Views
    2,921

    stack smashing? Studying file processing in C

    This code does what it is supposed to do, but at the end of the file, I get an error that I have never encountered before. What exactly is stack smashing? I suspect that the files and the...
  9. Replies
    3
    Views
    696

    pointers to functions

    Any one know some good exercises for pointers to functions?
  10. Replies
    12
    Views
    1,983

    Here is what I am trying to accomplish: 1)...

    Here is what I am trying to accomplish:

    1) Each hand should be invisible to the user, until a key is pressed or a sentinel value is enter.
    2) I need to score each hand and determine which hand...
  11. Replies
    12
    Views
    1,983

    Already re-wrote it. I can now deal multiple,...

    Already re-wrote it. I can now deal multiple, unique hands. I suppose I can use a loop to deal as many hands as I want or need.


    /*Improve shuffling algorithm
    */
    #include<stdio.h>...
  12. Replies
    12
    Views
    1,983

    Now I am going to move on to the next stage of...

    Now I am going to move on to the next stage of the assignment. I need the program(specifically the function deal) to be able to deal two hands and determine which hand wins. Thanks for the help
  13. Replies
    12
    Views
    1,983

    #include #include #include...

    #include <stdio.h>#include <stdlib.h>
    #include <time.h>
    #define CARDS 52
    #define SUITS 4
    #define FACES 13
    #define PAIR 2
    #define HAND 5
  14. Replies
    12
    Views
    1,983

    should I call those two functions in tandem? Do...

    should I call those two functions in tandem? Do I even need to build a new function at all?
  15. Replies
    12
    Views
    1,983

    I think I'm half way there with the two and three...

    I think I'm half way there with the two and three of a kind function. So I have to modify that if statement to check for two different suits, right?



    if(counter[p] == 3 && counter[p] == 2)
    ...
  16. Replies
    12
    Views
    1,983

    I have fixed all the errors (namely, that some...

    I have fixed all the errors (namely, that some variables were named as const and could not be modified, but needed to.)

    Now I want to know how I can go about determining if a hand is actually a...
  17. Replies
    12
    Views
    1,983

    beginning of a poker game.

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #define CARDS 52
    #define SUITS 4
    #define FACES 13
    #define PAIR 2
    #define HAND 5
  18. Thread: meanmedianmode.c

    by jwall
    Replies
    2
    Views
    830

    Thanks. Its been a long day.

    Thanks. Its been a long day.
  19. Thread: meanmedianmode.c

    by jwall
    Replies
    2
    Views
    830

    meanmedianmode.c

    /*
    improve meanmedianmode.c
    */
    #include<stdio.h>
    #include<stdlib.h>
    #include<time.h>
    #define SIZE 100
    double median(int array, int arrayLength);
    void mode(int array[], int arrayLength);...
  20. Replies
    6
    Views
    1,548

    Build a better bubble sort

    Can someone look over this code and provide constructive criticism? Thanks

    /*Make improvements to the bubble sort
    */


    #include<stdio.h>
    #include<stdlib.h>
    #include<time.h>
    void...
  21. Thread: airplane.c

    by jwall
    Replies
    3
    Views
    1,086

    fixed //program to fill seats on a train...

    fixed



    //program to fill seats on a train
    #include<stdio.h>
    #include<stdlib.h>
    //function prototype
    void bookingProcedure(int whatClass);
    int wrongChairInsertion(int whatClass, int chair);
  22. Thread: airplane.c

    by jwall
    Replies
    3
    Views
    1,086

    airplane.c

    anyone have any idea to make this code a little better? It works, but I'm wondering if there is a way to make it faster and more efficient.


    //program to fill seats on a train#include<stdio.h>...
  23. Replies
    2
    Views
    3,419

    Number of repetitions: 1 Time elapsed: 0 sec....

    Number of repetitions: 1
    Time elapsed: 0 sec.
    try won lost
    1 0 0
    2 0 0
    3 0 0
    4 1 0
    5 0 0
    6...
  24. Replies
    2
    Views
    3,419

    craps game with arrays

    This program works perfectly--except instead of counting to 100000
    it stops at some random number. When I try to move the RNG
    seed function, it will count up to 100000, but gives the wrong...
  25. Thread: craps.c

    by jwall
    Replies
    2
    Views
    4,579

    It works better now. I was trying to wrap the...

    It works better now. I was trying to wrap the entire game into a function that I could call from main. I decided that this wasn't necessary, though I would love to know how to do it.


    /*A...
Results 1 to 25 of 68
Page 1 of 3 1 2 3