#import ???

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

    #import ???

    HI,
    What is #import in c++? Why and Where do you use it?? first of all is
    import is a c++ keyword??

    Cheers.....

  • Bob Smith

    #2
    Re: #import ???

    Radde wrote:
    [color=blue]
    > HI,
    > What is #import in c++? Why and Where do you use it?? first of all is
    > import is a c++ keyword??
    >
    > Cheers.....[/color]
    you mean #include? then yes,
    import is java stuff

    --

    Comment

    • red floyd

      #3
      Re: #import ???

      Radde wrote:[color=blue]
      > HI,
      > What is #import in c++? Why and Where do you use it?? first of all is
      > import is a c++ keyword??
      >
      > Cheers.....[/color]
      It's a Microsoft-ism, having to do with COM or .NET.

      Ask in microsoft.publi c.vstudio.*

      Comment

      • Rolf Magnus

        #4
        Re: #import ???

        Radde wrote:
        [color=blue]
        > HI,
        > What is #import in c++?[/color]

        Nothing like that in standard C++.
        [color=blue]
        > Why and Where do you use it?? first of all is
        > import is a c++ keyword??[/color]

        No, it's a syntax error.

        Comment

        • John Dibling

          #5
          Re: #import ???

          Radde wrote:[color=blue]
          > HI,
          > What is #import in c++? Why and Where do you use it?? first of all is
          > import is a c++ keyword??[/color]

          #import is not a Standard C++ keyword. #import is an MSVC language
          extension; not part of Standard C++. It's used to bring in the symbols
          from a compiled typelibrary (ie, '#import "mylib.tlb" ') or an IDL file
          (ie, '#import "mylib.idl" ')

          Take care,

          John Dibling

          Comment

          • kelvSYC

            #6
            Re: #import ???

            > What is #import in c++? Why and Where do you use it?? first of all is[color=blue]
            > import is a c++ keyword??[/color]

            It's a gcc extension that works similar to #include, but in which the
            compiler ensures that a file is never included more than once. It is
            provided in several other compilers as well.

            Its inclusion in gcc as a preprocessor extension is due to the fact
            that the Objective-C and Objective-C++ languages have it as part of
            their language.

            --
            I am only a mirage.

            Comment

            • ben

              #7
              Re: #import ???

              [color=blue]
              > Its inclusion in gcc as a preprocessor extension is due to the fact
              > that the Objective-C and Objective-C++ languages have it as part of
              > their language.
              >
              > --
              > I am only a mirage.[/color]

              I'm just wondering, where the heck came the Objective C++??? Is C++ not
              complex enough that we need another language to fill our brain??

              ben


              Comment

              • Clark S. Cox III

                #8
                Re: #import ???

                On 2005-06-23 07:57:55 -0400, "ben" <benhongh@hotma il.com> said:
                [color=blue]
                >[color=green]
                >> Its inclusion in gcc as a preprocessor extension is due to the fact
                >> that the Objective-C and Objective-C++ languages have it as part of
                >> their language.[/color]
                >
                > I'm just wondering, where the heck came the Objective C++??? Is C++ not
                > complex enough that we need another language to fill our brain??[/color]

                [OT]
                Objective-C++ is just the compiler allowing Objective-C and C++ code in
                the same translation unit. This is required if you want to call C++
                from Objective-C (or vice versa) without using a bunch of extern "C"
                functions as intermediaries.
                [/OT]


                --
                Clark S. Cox, III
                clarkcox3@gmail .com

                Comment

                • kelvSYC

                  #9
                  Re: #import ???

                  > [OT][color=blue]
                  > Objective-C++ is just the compiler allowing Objective-C and C++ code in
                  > the same translation unit. This is required if you want to call C++
                  > from Objective-C (or vice versa) without using a bunch of extern "C"
                  > functions as intermediaries.
                  > [/OT][/color]

                  That's pretty much it, but there are a few technical things that having
                  C++ instead of C as a "base language" as a result (eg. obj-c classes
                  only permit structure/class members when they are pod, obj-c selectors
                  allow reference arguments, some implementations also allow the C++ side
                  to use restricted pointers), and a few really annoying things that
                  result (sizeof(BOOL) == 1, but sizeof(bool) is machine-dependent). But
                  that's really going off-topic.

                  --
                  I am only a mirage.

                  Comment

                  Working...