Search:

Type: Posts; User: AndiPersti

Search: Search took 0.01 seconds.

  1. Replies
    18
    Views
    2,778

    Salem, are you on a 64bit system? Bug 6453...

    Salem, are you on a 64bit system?

    Bug 6453 – scanf integer overflow handling different between 32bit and 64bit

    Bye, Andreas
  2. Replies
    18
    Views
    2,778

    Interesting. When I run your code I get: $...

    Interesting. When I run your code I get:


    $ ./foo
    2147483647
    9223372036854775807
    Enter number: 2147483648
    Number out of range, try again: Numerical result out of range
    Enter number:...
  3. Replies
    18
    Views
    2,778

    You're right. I haven't read the man-page...

    You're right. I haven't read the man-page carefully enough:


    So ERANGE for sscanf() only works with the GNU C Library.

    Bye, Andreas
  4. Replies
    18
    Views
    2,778

    My code is tolerant and accepts a number if the...

    My code is tolerant and accepts a number if the input starts with it and discards any following characters.
    If you only want "clean" numbers (nothing before and after) I suggest a combination of...
  5. Replies
    18
    Views
    2,778

    Have you ever heard of the KISS principle...

    Have you ever heard of the KISS principle?

    A simple do-while-loop is all you need:


    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
Results 1 to 5 of 5