Segmentation fault with array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ptq2238@gmail.com

    Segmentation fault with array

    Hi, I'm getting confused with arrays and hope someone can shed light
    on my code.
    I wrote this to try and learn about files and arrays as I thought if I
    could grab each element and place them into an array I can manipulate
    the stings from the file with array indexes.
    Perhaps there's a better method but I'm learning.

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

    int main()
    {
    char c;
    int num=0;
    int count=0;
    int i;
    char instring[10];

    FILE * fp;

    if((fp=fopen("t estdata.txt","r "))==NULL)
    {
    printf("Error in openning the file.\n");
    exit(2);
    }

    while(!feof(fp) )
    {
    num++;
    if ((c = getc(fp))==EOF)
    {
    printf("EOF reached \n");
    break;
    }
    else
    {
    if (c != '\0')
    {
    instring[count] =c;
    printf("count = %d, instring = %c\n",count,ins tring[count]);
    count++;
    }
    }
    }

    i=0;
    printf("char 3 is %c\n",instring[i+3]);

    return 0;
    }

    The testdata.txt contains
    ab$
    e.f
    1we
    @\/
    "@'
    :]_
    ..

    When I execute the program I get the following result:
    count = 0, instring = a
    count = 1, instring = b
    count = 2, instring = $
    count = 3, instring =

    count = 4, instring = e
    count = 5, instring = .
    count = 6, instring = f
    count = 7, instring =

    count = 8, instring = 1
    count = 9, instring = w
    count = 10, instring = e
    count = 11, instring =

    count = 12, instring = @
    count = 13, instring = \
    count = 14, instring = /
    count = 15, instring =

    count = 16, instring = "
    count = 17, instring = @
    count = 18, instring = '
    count = 19, instring =

    Segmentation Fault (core dumped)

    My question is if the instring has 10 elements then why is it printing
    out to element 19 ?
    If I put a large number, such as char instring[150], then it will work

    Have I misunderstood arrays completely ?

    Pat

  • Ian Collins

    #2
    Re: Segmentation fault with array

    ptq2238@gmail.c om wrote:
    Hi, I'm getting confused with arrays and hope someone can shed light
    on my code.
    I wrote this to try and learn about files and arrays as I thought if I
    could grab each element and place them into an array I can manipulate
    the stings from the file with array indexes.
    Perhaps there's a better method but I'm learning.
    >
    #include <stdio.h>
    #include <stdlib.h>
    >
    int main()
    {
    char c;
    int num=0;
    int count=0;
    int i;
    char instring[10];
    >
    FILE * fp;
    >
    if((fp=fopen("t estdata.txt","r "))==NULL)
    {
    printf("Error in openning the file.\n");
    exit(2);
    }
    >
    while(!feof(fp) )
    {
    num++;
    if ((c = getc(fp))==EOF)
    {
    printf("EOF reached \n");
    break;
    }
    else
    {
    if (c != '\0')
    {
    instring[count] =c;
    printf("count = %d, instring = %c\n",count,ins tring[count]);
    count++;
    }
    }
    }
    >
    i=0;
    printf("char 3 is %c\n",instring[i+3]);
    >
    return 0;
    }
    >
    >
    My question is if the instring has 10 elements then why is it printing
    out to element 19 ?
    If I put a large number, such as char instring[150], then it will work
    >
    Have I misunderstood arrays completely ?
    >
    You have an array of single characters, which you then fill, and keep
    writing to without checking if you have written past the end. It looks
    like you intended to read lines, rather than single characters.

    --
    Ian Collins.

    Comment

    • Michael

      #3
      Re: Segmentation fault with array

      Ian answered your actual question, so let me point out another problem
      in your code:
      char c;
      ....
      if ((c = getc(fp))==EOF)
      The function getc returns an integer. I know, that's crazy, but
      that's the way it is. (Not all standard library functions have good
      interfaces.) The comparison to EOF can fail (I forget whether it
      always does or only does on certain implementations ) if c is a
      character instead of an int.

      Michael

      Comment

      • Chris Dollin

        #4
        Re: Segmentation fault with array

        Michael wrote:
        Ian answered your actual question, so let me point out another problem
        in your code:
        >
        > char c;
        ...
        > if ((c = getc(fp))==EOF)
        >
        The function getc returns an integer. I know, that's crazy, but
        that's the way it is.
        Suppose `getc` returned a `char`. What `char` value would you
        pick to represent EOF and hence disallow from appearing in any
        FILE* input?

        Remember that FILE*s can be reading "binary" files.

        --
        Three-Way Secret Hedgehog
        A rock is not a fact. A rock is a rock.

        Comment

        • Bart van Ingen Schenau

          #5
          Re: Segmentation fault with array

          ptq2238@gmail.c om wrote:
          Hi, I'm getting confused with arrays and hope someone can shed light
          on my code.
          I wrote this to try and learn about files and arrays as I thought if I
          could grab each element and place them into an array I can manipulate
          the stings from the file with array indexes.
          Perhaps there's a better method but I'm learning.
          >
          #include <stdio.h>
          #include <stdlib.h>
          >
          int main()
          {
          char c;
          int num=0;
          int count=0;
          int i;
          char instring[10];
          >
          FILE * fp;
          >
          if((fp=fopen("t estdata.txt","r "))==NULL)
          {
          printf("Error in openning the file.\n");
          exit(2);
          }
          >
          while(!feof(fp) )
          {
          num++;
          if ((c = getc(fp))==EOF)
          {
          printf("EOF reached \n");
          break;
          }
          else
          {
          if (c != '\0')
          {
          instring[count] =c;
          printf("count = %d, instring = %c\n",count,ins tring[count]);
          count++;
          }
          }
          }
          >
          i=0;
          printf("char 3 is %c\n",instring[i+3]);
          >
          return 0;
          }
          >
          The testdata.txt contains
          ab$
          e.f
          1we
          @\/
          "@'
          :]_
          .
          >
          When I execute the program I get the following result:
          count = 0, instring = a
          count = 1, instring = b
          count = 2, instring = $
          count = 3, instring =
          >
          count = 4, instring = e
          count = 5, instring = .
          count = 6, instring = f
          count = 7, instring =
          >
          count = 8, instring = 1
          count = 9, instring = w
          count = 10, instring = e
          count = 11, instring =
          >
          count = 12, instring = @
          count = 13, instring = \
          count = 14, instring = /
          count = 15, instring =
          >
          count = 16, instring = "
          count = 17, instring = @
          count = 18, instring = '
          count = 19, instring =
          >
          Segmentation Fault (core dumped)
          >
          My question is if the instring has 10 elements then why is it printing
          out to element 19 ?
          If I put a large number, such as char instring[150], then it will work
          >
          Have I misunderstood arrays completely ?
          What you seem to be missing is that in C it is *your* responsibility, as
          a programmer, to ensure that you will not go outside the array bounds.
          The compiler is not required (and sometimes even not able) to check that
          you stay within array bounds.

          In your code, you were happily clobbering over some random memory, until
          the processor determined that something was seriously wrong. This is
          perfectly acceptable behaviour if the programmer forgets his/her duty
          to check array bounds. (By accessing memory outside the array bounds,
          you invoke undefined behaviour. Anything the computer does then is
          fully correct.)
          >
          Pat
          Bart v Ingen Schenau
          --
          a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
          c.l.c FAQ: http://www.eskimo.com/~scs/C-faq/top.html
          c.l.c++ FAQ: http://www.parashift.com/c++-faq-lite/

          Comment

          • Barry Schwarz

            #6
            Re: Segmentation fault with array

            On 18 May 2007 22:28:50 -0700, ptq2238@gmail.c om wrote:
            >Hi, I'm getting confused with arrays and hope someone can shed light
            >on my code.
            >I wrote this to try and learn about files and arrays as I thought if I
            >could grab each element and place them into an array I can manipulate
            >the stings from the file with array indexes.
            >Perhaps there's a better method but I'm learning.
            >
            >#include <stdio.h>
            >#include <stdlib.h>
            >
            >int main()
            >{
            char c;
            The return value from getc needs to be an int, not a char.
            int num=0;
            int count=0;
            int i;
            char instring[10];
            >
            FILE * fp;
            >
            if((fp=fopen("t estdata.txt","r "))==NULL)
            {
            printf("Error in openning the file.\n");
            exit(2);
            2 is not a portable return value from main. Use EXIT_FAILURE which is
            a macro that each system defines consistent with your environment.
            }
            >
            while(!feof(fp) )
            Since you test for EOF inside the loop, calling the function here is
            superfluous.
            {
            num++;
            if ((c = getc(fp))==EOF)
            It is not guaranteed that the char c can hold the value EOF. It needs
            to be an int.
            {
            printf("EOF reached \n");
            break;
            }
            else
            {
            if (c != '\0')
            In a text file, it is unlikely that c will ever equal '\0''\.
            {
            instring[count] =c;
            printf("count = %d, instring = %c\n",count,ins tring[count]);
            The fact that c was not equal to EOF or '\0' does not mean it is a
            printable character. It could have been '\n' indicating end of line
            (not end of file) or other common text markers such as '\t'.
            count++;
            }
            }
            }
            The most likely cause of your segmentation faults is not insuring that
            count never exceeds 9. Once it does and you attempt to store or print
            instring[10], you have exceeded the array bounds and invoked undefined
            behavior.
            >
            i=0;
            printf("char 3 is %c\n",instring[i+3]);
            >
            return 0;
            >}
            >
            >The testdata.txt contains
            >ab$
            >e.f
            >1we
            >@\/
            >"@'
            >:]_
            >.
            >
            >When I execute the program I get the following result:
            >count = 0, instring = a
            >count = 1, instring = b
            >count = 2, instring = $
            >count = 3, instring =
            >
            This is what happens when you attempt to printf a '\n' with %c.
            >count = 4, instring = e
            >count = 5, instring = .
            >count = 6, instring = f
            >count = 7, instring =
            >
            >count = 8, instring = 1
            >count = 9, instring = w
            >count = 10, instring = e
            Of course this element does not exist and everything from this point
            on is undefined behavior.
            >count = 11, instring =
            >
            >count = 12, instring = @
            >count = 13, instring = \
            >count = 14, instring = /
            >count = 15, instring =
            >
            >count = 16, instring = "
            >count = 17, instring = @
            >count = 18, instring = '
            >count = 19, instring =
            >
            >Segmentation Fault (core dumped)
            >
            >My question is if the instring has 10 elements then why is it printing
            >out to element 19 ?
            Because the c language does not require bounds checking during
            run-time. It was a design decision by the language developers to
            leave this task to the programmer. Since you didn't, you experienced
            to different possible manifestations of undefined behavior. The first
            ten times it did something "almost reasonable". The next time it did
            something so unreasonable your operating system had to intercede and
            terminate your program.
            >If I put a large number, such as char instring[150], then it will work
            It will work longer but if your file has more than 150 characters you
            will end up with the same problem. What you really need to do is add
            code to your while loop to check the value of count and do something
            special (terminate with a warning message, reset count back to 0, etc)
            when it exceeds the size of instring.
            >
            >Have I misunderstood arrays completely ?
            What did you expect to happen when you exceeded the array size?


            Remove del for email

            Comment

            • CBFalconer

              #7
              Re: Segmentation fault with array

              ptq2238@gmail.c om wrote:
              >
              Hi, I'm getting confused with arrays and hope someone can shed
              light on my code.
              I wrote this to try and learn about files and arrays as I thought
              if I could grab each element and place them into an array I can
              manipulate the stings from the file with array indexes.
              Perhaps there's a better method but I'm learning.
              >
              #include <stdio.h>
              #include <stdlib.h>
              >
              int main(void) { /* added void for clarity */
              char c;
              int num=0;
              int count=0;
              int i;
              char instring[10];
              FILE * fp;
              >
              if ((fp = fopen("testdata .txt","r")) == NULL) {
              printf("Error in openning the file.\n");
              exit(EXIT_FAILU RE); /* note change here **/
              }
              while (!feof(fp) && count < 10 ) { /* note change here **/
              num++;
              if ((c = getc(fp)) == EOF) {
              printf("EOF reached \n");
              break;
              }
              else {
              if (c != '\0') {
              instring[count] = c;
              printf("count = %d, instring = %c\n",
              count, instring[count]); /* clarity
              edit */
              count++;
              }
              }
              }
              i = 0;
              printf("char 3 is %c\n", instring[i + 3]);
              return 0;
              }
              I have edited your code slightly to reduce the vertical space.
              Note the added comments. Search for '**/'. It is up to you to
              ensure you do not write on unowned memory.

              --
              <http://www.cs.auckland .ac.nz/~pgut001/pubs/vista_cost.txt>
              <http://www.securityfoc us.com/columnists/423>
              <http://www.aaxnet.com/editor/edit043.html>
              <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
              cbfalconer at maineline dot net



              --
              Posted via a free Usenet account from http://www.teranews.com

              Comment

              • Michael

                #8
                Re: Segmentation fault with array

                On May 19, 12:23 am, Chris Dollin <e...@electrich edgehog.netwrot e:
                Michael wrote:
                Ian answered your actual question, so let me point out another problem
                in your code:
                >
                char c;
                ...
                if ((c = getc(fp))==EOF)
                >
                The function getc returns an integer. I know, that's crazy, but
                that's the way it is.
                >
                Suppose `getc` returned a `char`. What `char` value would you
                pick to represent EOF and hence disallow from appearing in any
                FILE* input?
                >
                Remember that FILE*s can be reading "binary" files.
                >
                --
                Alternately, suppose you wrote a function where the description is
                "read the next thing and return an int, not a char." Would you call
                such a function getc?

                Or suppose your description of your function was: sometimes return one
                thing, sometimes return another (e.g., return a char except if you
                don't, because you've reached end of file, or if an error occurs).
                Would you think that, perhaps, a better interface was in order?

                Or suppose you developed an interface that was commonly misused, and
                in fact, was incredibly easy to misuse, because you had a combination
                of: 1) outputs that mean different things, 2) a bad name, and 3) a
                common misuse pattern that can not be caught by the compiler. If you
                were the one to develop such an interface, I would blame you, not the
                poor schmucks who were confused by your inanity. Although I suppose
                that the typical thing is design such goofiness, document it, and them
                blame the person who uses the interface for not reading the
                documentation closely enough, regardless of how poorly the interface
                is designed.

                </rant>

                Michael


                Comment

                • ptq2238@gmail.com

                  #9
                  Re: Segmentation fault with array

                  Thank you for everyone's reply.
                  I've followed through with the suggestions and it's now working.
                  I think I would be better off by drawing up a diagram of my logic
                  first next time.



                  Comment

                  • guru.jois@gmail.com

                    #10
                    Re: Segmentation fault with array

                    On May 19, 10:43 am, Ian Collins <ian-n...@hotmail.co mwrote:
                    ptq2...@gmail.c om wrote:
                    Hi, I'm getting confused with arrays and hope someone can shed light
                    on my code.
                    I wrote this to try and learn about files and arrays as I thought if I
                    could grab each element and place them into an array I can manipulate
                    the stings from the file with array indexes.
                    Perhaps there's a better method but I'm learning.
                    >
                    #include <stdio.h>
                    #include <stdlib.h>
                    >
                    int main()
                    {
                    char c;
                    int num=0;
                    int count=0;
                    int i;
                    char instring[10];
                    >
                    FILE * fp;
                    >
                    if((fp=fopen("t estdata.txt","r "))==NULL)
                    {
                    printf("Error in openning the file.\n");
                    exit(2);
                    }
                    >
                    while(!feof(fp) )
                    {
                    num++;
                    if ((c = getc(fp))==EOF)
                    {
                    printf("EOF reached \n");
                    break;
                    }
                    else
                    {
                    if (c != '\0')
                    {
                    instring[count] =c;
                    printf("count = %d, instring = %c\n",count,ins tring[count]);
                    count++;
                    }
                    }
                    }
                    >
                    i=0;
                    printf("char 3 is %c\n",instring[i+3]);
                    >
                    return 0;
                    }
                    >
                    My question is if the instring has 10 elements then why is it printing
                    out to element 19 ?
                    If I put a large number, such as char instring[150], then it will work
                    >
                    Have I misunderstood arrays completely ?
                    >
                    You have an array of single characters, which you then fill, and keep
                    writing to without checking if you have written past the end. It looks
                    like you intended to read lines, rather than single characters.
                    >
                    --
                    Ian Collins.
                    HAI EVERYBODY. I AM NEW TO C. EVERYBODY ANSWERED TO QUESTION, BUT
                    NOBODY IS POINTING WHY HE/SHE HAS CHECKED FOR EOF TWICE IN THE
                    PROGRAM. IS IT NECESSARY????

                    Comment

                    • Army1987

                      #11
                      Re: Segmentation fault with array


                      "Michael" <mchlgibs@aol.c omha scritto nel messaggio
                      news:1179636168 .072747.279070@ w5g2000hsg.goog legroups.com...
                      On May 19, 12:23 am, Chris Dollin <e...@electrich edgehog.netwrot e:
                      >Michael wrote:
                      Ian answered your actual question, so let me point out another problem
                      in your code:
                      >>
                      > char c;
                      ...
                      > if ((c = getc(fp))==EOF)
                      >>
                      The function getc returns an integer. I know, that's crazy, but
                      that's the way it is.
                      >>
                      >Suppose `getc` returned a `char`. What `char` value would you
                      >pick to represent EOF and hence disallow from appearing in any
                      >FILE* input?
                      >>
                      >Remember that FILE*s can be reading "binary" files.
                      >>
                      >--
                      >
                      Alternately, suppose you wrote a function where the description is
                      "read the next thing and return an int, not a char." Would you call
                      such a function getc?
                      If you want to use fscanf(fp, "%c", &c) or fread(&c, 1, 1, fp) you
                      are free to use them. If you would like a function returning a
                      char, there would be no way to report EOF, unless it looked like
                      extern unsigned char get(FILE * restrict stream, int *flag), which
                      IMO is no improvement. So what's your point?


                      Comment

                      • Army1987

                        #12
                        Re: Segmentation fault with array


                        "Barry Schwarz" <schwarzb@doezl .netha scritto nel messaggio
                        news:mc7u43lial 8ji745l49m53hpq qauo99vji@4ax.c om...
                        On 18 May 2007 22:28:50 -0700, ptq2238@gmail.c om wrote:
                        >>When I execute the program I get the following result:
                        >>count = 0, instring = a
                        >>count = 1, instring = b
                        >>count = 2, instring = $
                        >>count = 3, instring =
                        >>
                        >
                        This is what happens when you attempt to printf a '\n' with %c.
                        What do you mean? printf("%c", '\n') is perfectly valid and does
                        exactly what it is supposed to do, as shown above.


                        Comment

                        • Army1987

                          #13
                          Re: Segmentation fault with array


                          <guru.jois@gmai l.comha scritto nel messaggio
                          news:1179678410 .501522.305830@ u30g2000hsc.goo glegroups.com.. .
                          On May 19, 10:43 am, Ian Collins <ian-n...@hotmail.co mwrote:
                          >ptq2...@gmail. com wrote:
                          Hi, I'm getting confused with arrays and hope someone can shed light
                          on my code.
                          I wrote this to try and learn about files and arrays as I thought if I
                          could grab each element and place them into an array I can manipulate
                          the stings from the file with array indexes.
                          Perhaps there's a better method but I'm learning.
                          >>
                          #include <stdio.h>
                          #include <stdlib.h>
                          >>
                          int main()
                          {
                          char c;
                          int num=0;
                          int count=0;
                          int i;
                          char instring[10];
                          >>
                          FILE * fp;
                          >>
                          if((fp=fopen("t estdata.txt","r "))==NULL)
                          {
                          printf("Error in openning the file.\n");
                          exit(2);
                          }
                          >>
                          while(!feof(fp) )
                          {
                          num++;
                          if ((c = getc(fp))==EOF)
                          {
                          printf("EOF reached \n");
                          break;
                          }
                          else
                          {
                          if (c != '\0')
                          {
                          instring[count] =c;
                          printf("count = %d, instring = %c\n",count,ins tring[count]);
                          count++;
                          }
                          }
                          }
                          >>
                          i=0;
                          printf("char 3 is %c\n",instring[i+3]);
                          >>
                          return 0;
                          }
                          >>
                          My question is if the instring has 10 elements then why is it printing
                          out to element 19 ?
                          If I put a large number, such as char instring[150], then it will work
                          >>
                          Have I misunderstood arrays completely ?
                          >>
                          >You have an array of single characters, which you then fill, and keep
                          >writing to without checking if you have written past the end. It looks
                          >like you intended to read lines, rather than single characters.
                          >>
                          >--
                          >Ian Collins.
                          >
                          HAI EVERYBODY. I AM NEW TO C. EVERYBODY ANSWERED TO QUESTION, BUT
                          NOBODY IS POINTING WHY HE/SHE HAS CHECKED FOR EOF TWICE IN THE
                          PROGRAM. IS IT NECESSARY????
                          >
                          No, it isn't.
                          They did that because the OP's code did that.


                          Comment

                          • Chris Dollin

                            #14
                            Re: Segmentation fault with array

                            Michael wrote:
                            On May 19, 12:23 am, Chris Dollin <e...@electrich edgehog.netwrot e:
                            >Michael wrote:
                            Ian answered your actual question, so let me point out another problem
                            in your code:
                            >>
                            > char c;
                            ...
                            > if ((c = getc(fp))==EOF)
                            >>
                            The function getc returns an integer. I know, that's crazy, but
                            that's the way it is.
                            >>
                            >Suppose `getc` returned a `char`. What `char` value would you
                            >pick to represent EOF and hence disallow from appearing in any
                            >FILE* input?
                            >>
                            >Remember that FILE*s can be reading "binary" files.
                            >
                            Alternately, suppose you wrote a function where the description is
                            "read the next thing and return an int, not a char." Would you call
                            such a function getc?
                            (a) No. But `getc` doesn't return "an int". It returns the int value
                            of a char or EOF. Typically it returns a `char`. I'd call it
                            `getChar`, and consider giving it return type CharOrEOF, or
                            Optional(char), or char??, depending on the language I was
                            writing this function in, and its observed conventions.

                            (b) I note you didn't answer my question. Either reach-the-next
                            char returns a char, and so can't signal EOF in its return value,
                            or it returns a non-char, and so can't signal the type of
                            the interesting value it returns. Perfection is a vice.
                            Or suppose your description of your function was: sometimes return one
                            thing, sometimes return another (e.g., return a char except if you
                            don't, because you've reached end of file, or if an error occurs).
                            Would you think that, perhaps, a better interface was in order?
                            I'd think a better /description/ was in order. Or a better programming
                            language.
                            Or suppose you developed an interface that was commonly misused, and
                            in fact, was incredibly easy to misuse, because you had a combination
                            of: 1) outputs that mean different things, 2) a bad name, and 3) a
                            common misuse pattern that can not be caught by the compiler. If you
                            were the one to develop such an interface, I would blame you, not the
                            poor schmucks who were confused by your inanity. Although I suppose
                            that the typical thing is design such goofiness, document it, and them
                            blame the person who uses the interface for not reading the
                            documentation closely enough, regardless of how poorly the interface
                            is designed.
                            Were there more room for manoeuver in the existing code, yes. There
                            isn't. It's a shame, but there it is.
                            </rant>
                            Oh no! The ENTIRE STACK of commentary is unwinding! Gibble ... umph ...

                            !gnidniwun si yratnemmoc fo KCATS ERITNE htT !on hO

                            (fx:snip)

                            --
                            Far-Fetched Hedgehog
                            The shortcuts are all full of people using them.

                            Comment

                            • Barry Schwarz

                              #15
                              Re: Segmentation fault with array

                              On Sun, 20 May 2007 18:45:18 +0200, "Army1987" <please.ask@for .it>
                              wrote:
                              >
                              >"Barry Schwarz" <schwarzb@doezl .netha scritto nel messaggio
                              >news:mc7u43lia l8ji745l49m53hp qqauo99vji@4ax. com...
                              >On 18 May 2007 22:28:50 -0700, ptq2238@gmail.c om wrote:
                              >
                              >>>When I execute the program I get the following result:
                              >>>count = 0, instring = a
                              >>>count = 1, instring = b
                              >>>count = 2, instring = $
                              >>>count = 3, instring =
                              >>>
                              >>
                              >This is what happens when you attempt to printf a '\n' with %c.
                              >
                              >What do you mean? printf("%c", '\n') is perfectly valid and does
                              >exactly what it is supposed to do, as shown above.
                              >
                              Of course it is.

                              Since the OP asked why his output was strange without specifying what
                              he found strange other than the segfault, I annotated everything I
                              thought a newcomer would be puzzled by.


                              Remove del for email

                              Comment

                              Working...