[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            rightstr - return the right portion of a string

  Syntax              char *rightstr(char *source, int len);

  Prototype in        stringhk.h

  Remarks             rightstr performs just like its BASIC counterpart
                      MID$().

                      rightstr returns the middle part of a string.

  Return value        rightstr returns the rightmost len characters of
                      source. If the length of source is less than len,
                      the entire string is returned.

                      rightstr returns a pointer to the storage location
                      containing the new string, or NULL if space could
                      not be allocated.

  See also            leftstr(), midstr()

  Example             #include <stringhk.h>
                      #include <stdio.h>            /* for the printf */

                      main()
                      {
                           char msg[25], *r;

                           strcpy(msg,"This is another test");
                           r = right(msg,7);
                           printf("%s\n",msg);
                           printf("%s\n",r);
                      }

  Program output      This is another test
                      er test


See Also: leftstr() midstr()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson