Reg virtual function and friend function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • csudha

    #1

    Reg virtual function and friend function

    Hi all!
    Please explain the usage of virtual function and friend function
    with some examples.
    Thanks,
    Sudha.
  • Michael Mair

    #2
    Re: Reg virtual function and friend function

    csudha wrote:[color=blue]
    > Hi all!
    > Please explain the usage of virtual function and friend function
    > with some examples.
    > Thanks,
    > Sudha.[/color]

    We also do not have these in C.
    Read the c.l.c++ FAQ or buy the book by Stroustrup.

    -Michael
    --
    E-Mail: Mine is an /at/ gmx /dot/ de address.

    Comment

    • infobahn

      #3
      Re: Reg virtual function and friend function

      csudha wrote:[color=blue]
      >
      > Hi all!
      > Please explain the usage of virtual function and friend function[/color]

      Both of these identifiers are in "user namespace", so you can make
      them do whatever you like.
      [color=blue]
      > with some examples.[/color]

      #include <stdio.h>

      int virtual(void)
      {
      return printf("Hello, virtual reality.\n");
      }

      int friend(void)
      {
      return printf("Hello, friend.\n");
      }

      Or whatever. The world is your oyster.

      Comment

      • Michael Mair

        #4
        Re: Reg virtual function and friend function

        infobahn wrote:[color=blue]
        > csudha wrote:
        >[color=green]
        >>Hi all!
        >> Please explain the usage of virtual function and friend function[/color]
        >
        >
        > Both of these identifiers are in "user namespace", so you can make
        > them do whatever you like.
        >
        >[color=green]
        >>with some examples.[/color]
        >
        >
        > #include <stdio.h>
        >
        > int virtual(void)
        > {
        > return printf("Hello, virtual reality.\n");
        > }
        >
        > int friend(void)
        > {
        > return printf("Hello, friend.\n");
        > }
        >
        > Or whatever. The world is your oyster.[/color]

        Splendid *g*


        Cheers
        Michael
        --
        E-Mail: Mine is an /at/ gmx /dot/ de address.

        Comment

        • CBFalconer

          #5
          Re: Reg virtual function and friend function

          infobahn wrote:[color=blue]
          > csudha wrote:[color=green]
          >>
          >> Please explain the usage of virtual function and friend function[/color]
          >
          > Both of these identifiers are in "user namespace", so you can make
          > them do whatever you like.
          >[color=green]
          >> with some examples.[/color]
          >
          > #include <stdio.h>
          >
          > int virtual(void)
          > {
          > return printf("Hello, virtual reality.\n");
          > }
          >
          > int friend(void)
          > {
          > return printf("Hello, friend.\n");
          > }
          >
          > Or whatever. The world is your oyster.[/color]

          You are in a devious mood today. Unfortunately the reply doesn't
          point out the error of his ways - ask C++ questions in a C++
          newsgroup, not a C newsgroup.

          --
          "If you want to post a followup via groups.google.c om, don't use
          the broken "Reply" link at the bottom of the article. Click on
          "show options" at the top of the article, then click on the
          "Reply" at the bottom of the article headers." - Keith Thompson


          Comment

          • infobahn

            #6
            Re: Reg virtual function and friend function

            CBFalconer wrote:[color=blue]
            >
            > You are in a devious mood today. Unfortunately the reply doesn't
            > point out the error of his ways - ask C++ questions in a C++
            > newsgroup, not a C newsgroup.[/color]

            I remain to be convinced that they were C++ questions. :-)

            Comment

            Working...