Search:

Type: Posts; User: RyeDunn

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    1,568

    sorry

    sorry to keep asking but this has me baffeled.....

    I changed a few things to simplify it and to debug.

    When I put this:

    maxnum = atoi( max );
    if( maxnum > 20 )
    return BOOL_TRUE;
    else
  2. Replies
    7
    Views
    1,568

    somethign like this? static int...

    somethign like this?



    static int validate_whole ( char *max )
    {
    int maxnum;

    while ( *max != '\0' )
    if ( !isdigit ( *max++))
  3. Replies
    7
    Views
    1,568

    very cool but one more thing

    within that same function
    static int validate_whole ( char *max )
    {
    while ( *max != '\0' )
    if ( !isdigit ( *max++))
    return BOOL_FALSE;
    return BOOL_TRUE;
    }

    If I wanted to narrow the...
  4. Replies
    7
    Views
    1,568

    need a second pair of eyes to debug

    This is just a piece of the code but I believe the problem the is in the function where '\n' is read along with the input, therefore everthing is FLASE. (please tell me if Im wrong.) So I tried to...
  5. Replies
    8
    Views
    2,136

    THATS IT!

    Sorry if I was too vague.

    Thanks for your help!
  6. Replies
    8
    Views
    2,136

    ok Im still messing with it...

    ok did get salems code to work, but is there anyway to get the same thing accomplished within the function?

    here is the full function:

    static int valid( char array[], int maxnum )
    {
    int...
  7. Replies
    7
    Views
    4,498

    program and results

    If you look at the progs output, it appears that the following number entered always writes over the previous number and splits the numbers into individual characters and puts each into its own cell,...
  8. Replies
    7
    Views
    4,498

    Im too vague

    I knew if I put that it would have been something that was pointed out....

    I did try that and I do have that now but Im still having problems... Im at home now (and drunk if you dont mind, hah) so...
  9. Replies
    7
    Views
    4,498

    umm

    pardon my ignorance, but isnt that what I was doing with sscanf( a, "%c", &a[e] ); ?
  10. Replies
    7
    Views
    4,498

    sscanf (I think)

    Im having some difficulties inputing elements into an array using sscanf. (The book Im using only has one like about sscanf). Anyway, all Im trying to do is input numbers into an array using...
  11. Replies
    2
    Views
    1,093

    WHOA!

    WHOA! :eek: very cool. :cool:

    I was using a double at the end because my function (see below) worked better if I used it.


    static int valid( char array[], int count )
    {
    int i = 0,...
  12. Replies
    2
    Views
    1,093

    One problem at a time.

    Okay I know this snippit here has a ton of problems but there is one inparticular that is troubling me.

    Under the GATHER DATA section, When a number is entered it is checked via a validate...
  13. Replies
    5
    Views
    1,323

    huh

    well Im home now and I was using salems code at work, but I swear it wasnt working properly.. but now that Im trying it from home.... I see it does work. go figure!

    Well I guess that means...
  14. Replies
    5
    Views
    1,323

    cool but

    ok very nice, Im much closer.... but if a the input was something like : 54k6 it would accept 54 and not return an error?

    What did I miss? I thought this would go through each character and if...
  15. Replies
    5
    Views
    1,323

    Im getting a headache

    lately I have been asking questions a bit over my head so Im trying to break things down a little so I can understand it better.

    What Im trying to do is look at all integers and if any of them are...
  16. Replies
    8
    Views
    1,203

    yeah I think you are right, Im going to start...

    yeah I think you are right, Im going to start rewriting the validate function instead of trying to work around it.
  17. Replies
    8
    Views
    1,203

    Isnt that what: sscanf(buffer, "%lf", &a); does?...

    Isnt that what: sscanf(buffer, "%lf", &a); does?


    And after adding the mentioned lines Im getting the error:
    error C2371: 'bool' : redefinition; different basic types

    Is there something else...
  18. Replies
    8
    Views
    1,203

    what Im trying to do...

    Ok here is what I have done and what Im trying to do.

    I would like this to simply verify an integer is valid. Letters, spaces, multiple (- and .)s etc should all return false and the program will...
  19. Replies
    8
    Views
    1,203

    Im going to try again

    I posted something like this yesterday but I used a string as the input arguement type because I didnt know what else to use that actually worked and it took the emphasis of what I was really trying...
  20. Thread: getline in C?

    by RyeDunn
    Replies
    2
    Views
    2,359

    getline in C?

    I could use cin but I would like to learn other ways of handling this. I have looked up the getline function but Im having problems implementing it for this program.

    Im hoping you people could...
  21. Thread: fflush(stdin)

    by RyeDunn
    Replies
    24
    Views
    60,413

    Prelude

    I might be beating a dead horse on this but:

    >fflush ( stdin ) is undefined, don't use it.
    Could you recommend something else that would be better?


    // GATHER DATA
    for (e = 0; e < maxnum;...
  22. Thread: fflush(stdin)

    by RyeDunn
    Replies
    24
    Views
    60,413

    none taken

    no offense taken... I know its all in fun and some of the questions I do ask are in the book/FAQs but sometime I have difficulty understanding or implementing it in my specific program.

    Speaking...
  23. Thread: fflush(stdin)

    by RyeDunn
    Replies
    24
    Views
    60,413

    1000

    Hammer,
    Im honored to be the one you decided to slam for your 1000th post. Congrats. :cool:

    Rye
  24. Thread: fflush(stdin)

    by RyeDunn
    Replies
    24
    Views
    60,413

    ouch

    tough crowd.
  25. Thread: fflush(stdin)

    by RyeDunn
    Replies
    24
    Views
    60,413

    ahh

    I understand now.... you guys rock!

    Just wait until you see what my next question is going to be tomorrow.. . muhahah

    :D
Results 1 to 25 of 37
Page 1 of 2 1 2