C++ : Java Glossary

go to home page C words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish 2008-09-17 by Roedy Green ©1996-2009 Canadian Mind Products
index page for letter ⇒ punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
C++
The forefather of Java. You can call C++ routines from Java via native method calls. I learned C++ before Java. Much of my trouble at the beginning came from presuming they worked the same way just because they look similar.
Differences Compiling
Microsoft C++ Keywords Costs
Microsoft C++ sizeof Books
C/C++ Header Libraries Links

Differences between C++ and Java

The major differences between C++ and Java are: Learning Java is much like learning a foreign language. The sooner you start learning to think in the language, rather than think in your native language (C++) and translating, the better command of the language you develop. This is even truer of Java than most other computer languages because Java is so strongly idiomatic. There are canned ways of doing almost everything. You build very little from scratch from the primitive elements.

Java superficially looks a lot like C++, but nearly all my trouble learning Java came from presuming it should work the same as C++ or should have buried somewhere some feature I used in C++. It works quite differently inside and has a completely different design philosophy. The rule of thumb is, don’t presume Java works the same as C++ just because the syntax looks the same. Java is a bit like an angler fish that dangles a C++ syntax lure to seduce C++ programmers into trying Java (for their own good, of course).

Microsoft C++ Keywords

Microsoft C++ Keywords
__abstract __int __try_cast delete goto property true
__alignof __int6 __unaligned deprecated if protected try
__asm __int64 __unhook dllexport in public typedef
__assume __int8 __uuidof dllimport initonly ref typeid
__based __interface __value do inline register typename
__box __leave __virtual_inheritance double int reinterpret_cast union
__cdecl __m64 __w64 dynamic_cast interface return unsigned
__declspec __m8 __wchar_t each interior_ptr safecast using
__delegate __m8d abstract else literal sealed uuid
__event __m8i array enum long selectany value
__except __multiple_inheritance bool event mutable short virtual
__fastcall __nogc break explicit naked signed void
__finally __noop case extern namespace sizeof volatile
__finally __pin catch false new static wchar_t
__forceinline __property char finally noinline static_cast while
__gc __raise class float noreturn struct  
__hook __sealed const for nothrow switch  
__identifier __single_inheritance const_cast friend novtable template  
__if_exists __stdcall continue friend_as nullptr this  
__if_not_exists __super default gcnew operator thread  
__inline __try delegate generic private throw  

Microsoft C++ sizeof

The sizes of various data types is platform dependent in C++, however here is what they mean when developing for Microsoft Windows Vista C++.
sizeof various data types is Microsoft C++ for Windows Vista
C++ Type Closest
Java Type
Bytes Bits Notes
boolean boolean 1 8 1-byte boolean, defined as unsigned char.
BOOLEAN boolean 1 8 1-byte boolean
byte byte 1 8 unsigned
BYTE byte 1 8 unsigned
char byte 1 8 8-bit signed chars.
unsigned char byte 1 8 8-bit unsigned chars.
TCHAR char 2 16 Unicode 16-bit chars. On older systems compiles to 8-bit.
wchar_t char 2 16 Unicode 16-bit unsigned chars
WCHAR char 2 16 Unicode 16-bit unsigned chars
short short 2 16 signed
USHORT char 2 16 unsigned
int int 4 32 signed
size_t int 4 32 unsigned
BOOL boolean 4 32 4-byte boolean
long int 4 32 signed
DWORD int 4 32 unsigned
void* Object 4 32 Pointer/Reference
float float 4 32 IEEE float
long long long 8 64 signed
double double 8 64 IEEE double
See also the table of JNI types. I discovered the information for the above table by running the following C++ program. You can modify it to prepare a list of types and sizes for your C/C++ projects.

C/C++ Header Libraries

To use a C/C++ method you need include its prototype in a header file. Here are some of the most common header files and what the rougly contain:
Common C/C++ header files
Header Contents
afx.h includes Windows API and common C headers too.
afxcmn.h MFC support for Windows Common Controls
afxdtctl.h MFC support for Internet Explorer 4 Common Controls
afxext.h MFC extensions
afxwin.h MFC core and standard components
assert.h assert
conio.h getch, putch
ctype.h isUpper, isLower, toUpper
direct.h chdir, mkdir
dos.h DOS API
fcntl.h open flags: O_RDONLY, _O_CREAT, _O_EXCL
io.h _chsize, _chmod, _lseek
jni.h Java JNI library
mmsystem.h playsound
process.h exec, spawn
resource.h generated to include resources
share.h sharing flags: _SH_DENYRW, _SH_DENYWR, _SH_DENYRD, _SH_DENYNO, _SH_SECURE
stdafx.h standard precompiled header
stdio.h fclose, fgetc, printf, remove, rename, setvbuf
stdlib.h exit, putenv, splitpath
string.h strcpy, strcat, strcmp, strupr
sys\stat.h read/write permissions: _S_IREAD, _S_IWRITE
tchar.h 16-bit chars, TCHAR
winbase.h time structures: _FILETIME, _SYSTEMTIME
windows.h Windows API

Compiling

For the free MS Visual C++ Express 9 aka Visual C++ 2008 Express, you most commonly want to configure your project as a console application without precompiled headers.. The command line equvalents to your GUI options should look something like this for debug:
and like this for release:
You can safely delete compiler intermediate files: *.ilk *.aps *.ncb *.pch *.pbd.

Costs

Books

book cover recommend book⇒C++ For Java Programmers
 paperback
ISBN13:978-0-201-61246-2clickcounter
ISBN10:0-201-61246-1clickcounter
publisher:Addison Wesley
published:1999-04-02
by:Timothy A. Budd
This is the same title as Mark Weiss’s book. Note the direction. Most books presume you know C++ and need to learn Java. This one presumes you know Java and need to learn or brush up on C++ for doing JNI or related work.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag
book cover recommend book⇒C++ For Java Programmers
 hardcover
ISBN13:978-0-13-919424-5clickcounter
ISBN10:0-13-919424-Xclickcounter
publisher:Prentice Hall
published:2003-11-07
by:Timothy A. Budd
This is the same title as Timothy Budd’s book. Note the direction. Most books presume you know C++ and need to learn Java. This one presumes you know Java and need to learn or brush up on C++ for doing JNI or related work.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag
book cover recommend book⇒Beginning Visual C++ 6
 paperback
ISBN13:978-1-86100-088-0clickcounter
ISBN10:1-86100-088-Xclickcounter
publisher:Wrox Press
published:1998-08
by:Ivor Horton
A gentle, easy-paced introduction to C++.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag

book cover recommend book⇒Accelerated C++: Practical Programming by Example
 paperback
ISBN13:978-0-201-70353-5clickcounter
ISBN10:0-201-70353-Xclickcounter
publisher:Addison-Wesley
published:2000-08-24
by:Andrew Koenig, Barbara E. Moo
Recommended for people who know Java and want to learn C++.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag
book cover recommend book⇒The Design and Evolution of C++
 paperback
ISBN13:978-0-201-54330-8clickcounter
ISBN10:0-201-54330-3clickcounter
publisher:Addison-Wesley
published:1994-04-08
by:Bjarne Stroustrup
This is a fascinating book about the birth of a new computer language C++. He talks about the politics, the compromises, and the factors that made him design C++ the way it is.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag
book cover recommend book⇒The C++ Programming Language (3rd Edition)
 paperbackhardcover
ISBN13:978-0-201-88954-3clickcounter978-0-201-70073-2clickcounter
ISBN10:0-201-88954-4clickcounter0-201-70073-5clickcounter
publisher:Addison-Wesley
published:1997-06-30
by:Bjarne Stroustrup
A reference manual for C++, rather formal.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag
book cover recommend book⇒The Annotated C++ Reference Manual
 paperback
ISBN13:978-0-201-51459-9clickcounter
ISBN10:0-201-51459-1clickcounter
publisher:Addison-Wesley
published:1990-01-11
by:Margaret A. Ellis, Bjarne Stroustrup
A book for language lawyers on the fine points of C++. It is not suitable for initially learning the language. It is really more aimed at compiler writers. It covers C++ implementation techniques including vtbls.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag
book cover recommend book⇒Java Programming: Making the Move from C++
 paperback
ISBN13:978-1-85032-922-0clickcounter
ISBN10:1-85032-922-2clickcounter
publisher:International Thomson Computer Press
published:1998-07-21
by:Joe Wigglesworth and Paula Lumby
Does not discuss anything past Java 1.1.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag

CMP homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.62] The information on this page is for non-military use only.
You are visitor number 11,259. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/cpp.html J:\mindprod\jgloss\cpp.html