#import ???

R

Radde

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

Cheers.....
 
R

red floyd

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

Cheers.....
It's a Microsoft-ism, having to do with COM or .NET.

Ask in microsoft.public.vstudio.*
 
B

Bob Smith

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

Cheers.....
you mean #include? then yes,
import is java stuff
 
J

John Dibling

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

#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
 
K

kelvSYC

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

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.
 
B

ben

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'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
 
C

Clark S. Cox III

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??

[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]
 
K

kelvSYC

[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]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,368
Latest member
EwanMacvit

Latest Threads

Top