Search:

Type: Posts; User: sweetorangepie

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    1,086

    thanks for the help with the prototype. I do...

    thanks for the help with the prototype.

    I do have a "timefinished", and I have just realised I dont need them as global variables.

    P.S. Whats the significants of the astrix symbol in this, I...
  2. Replies
    8
    Views
    1,086

    Thanks for that dave, thats got it working!!! ...

    Thanks for that dave, thats got it working!!!

    How would I make a function prototype for that kind of function, i've never used them before.

    Also I need to have timestarted as a global variable...
  3. Replies
    8
    Views
    1,086

    thanks for the help, This has stoped the...

    thanks for the help,

    This has stoped the errors but i'm getting a new one now:


    423: warning: return makes integer from pointer without a cast

    The line of code which this is refering to is:
  4. Replies
    8
    Views
    1,086

    help with function

    I'm having some trouble getting a function to work, can anyone help.

    I've got a function that gets the current time and i'm trying to return the value into a variable. This is the function at...
  5. matsp i've just tried what you suggested and it...

    matsp i've just tried what you suggested and it compiles but nothing happens? I'm not sure if what you suggested will do what I need, what I need is something that will get the current system date...
  6. Question about Function: int gettimeofday

    I'm making a log file for my program and I need to inset a time and date stamp. I've had a look through the GNU C Libary and found the gettimeofday function but I'm having a little trouble...
  7. Replies
    6
    Views
    1,126

    Todd Burch, you my friend are a legend, 300 lines...

    Todd Burch, you my friend are a legend, 300 lines of code and all that was wrong was 1 digit, I hate C....
  8. Replies
    6
    Views
    1,126

    Problem with loop

    I'm trying to write some code which will take the value from one variable ( multiple guesses ), format it and split it up into diffrent variables (one for each guess). I have a set of if statements...
  9. Replies
    8
    Views
    2,221

    This is the simplest version of what i'm trying...

    This is the simplest version of what i'm trying to achieve:


    int main (void)

    recent = show_recent(guess);
    if (0 != recent){
    printf("\n%s", recent_guess1);
    printf("%s",...
  10. Replies
    8
    Views
    2,221

    i have now changed it to: return...

    i have now changed it to:


    return ((strcmp(checkvalue, "recent") == 0)||(strcmp(checkvalue, "RECENT") == 0)||(strcmp(checkvalue, "Recent") == 0));

    but it is no longer returning a 1, what am i...
  11. Replies
    8
    Views
    2,221

    I've just figured out thats what the number 1 was...

    I've just figured out thats what the number 1 was doing in that. How would i use strcmp, just the same but without the number at the end?

    Thanks Again
  12. Replies
    8
    Views
    2,221

    question about strncmp

    I'm using strncmp to return a 1 if the user has typed in recent:


    return ((strncmp(checkvalue, "recent", 1) == 0)||(strncmp(checkvalue, "RECENT", 1) == 0)||(strncmp(checkvalue, "Recent", 1) ==...
  13. error: called object is not a function

    I have a function which is giving me an error:

    error: called object is not a function

    The function which the error is relating to is this one:


    int show_recent( char* checkvalue )
    {
    if...
  14. Replies
    3
    Views
    1,931

    well that was a stupid mistake, Thanks for...

    well that was a stupid mistake,

    Thanks for fixing that!!!
  15. Replies
    3
    Views
    1,931

    Problem with switch loop

    I'm having some trouble with this switch loop:


    switch (guess_counter)
    {
    case 1;
    strcpy (recent_guess1, user_input);
    guess_counter++;
    break;
    case 2;
  16. Replies
    17
    Views
    2,194

    This is what the code is now: do{...

    This is what the code is now:



    do{
    printf("---Welcome to Mastmind--- \n");
    printf("Please enter your name: ");
    fgets(username, 20, stdin);
    exit_check =...
  17. Replies
    17
    Views
    2,194

    ok I understand now, sorry about my noobyness, I...

    ok I understand now, sorry about my noobyness, I think I can get it to work now, is there anyway of breaking out of a loop while in another function???

    Thanks Guys, Appriciate it
  18. Replies
    17
    Views
    2,194

    thanks for the help with that and I understand...

    thanks for the help with that and I understand how that would work and have added the changes that you have suggested but it still doesn't work, it just goes to the next line of the code. Do you...
  19. Replies
    17
    Views
    2,194

    oh fair enougth I see, where should I put the...

    oh fair enougth I see, where should I put the break, should this go in the end game function as the program goes there if exit has been typed???

    Thanks for your help, its much appriciated.
  20. Replies
    17
    Views
    2,194

    ok so it never actualy stops. So is there...

    ok so it never actualy stops. So is there something wrong with my loop then, I dont understand why it works in the mock up and not in my main code, can anyone explain this.

    Thanks
  21. Replies
    17
    Views
    2,194

    ok i have made some changes, and from what I...

    ok i have made some changes, and from what I understand a C program will close when it gets to the end of the main function. The exit check is used in a loop around the program which carry's on so...
  22. Replies
    17
    Views
    2,194

    I have changed the strncmp to check 4 letters but...

    I have changed the strncmp to check 4 letters but this has made no diffrence. I have also removed that line and it still has no effect, i'm attaching the full code to see if it would help.
  23. Replies
    17
    Views
    2,194

    I've just tried adding \n to the strncmp but it...

    I've just tried adding \n to the strncmp but it didn't make a diffrence. The reason it changes username to checkvar is becuase i will use the function to check variables other than username later...
  24. Replies
    17
    Views
    2,194

    problem exiting program

    Hi, I'm writing a program for an assignment are that you are able to exit the program at anytime by typing exit. I have created a mockup where is passes the variable you want to check says exit...
Results 1 to 24 of 24