C++ : Java Glossary

The CurrCon Java Applet displays prices on this web page converted with today’s exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires an up-to-date browser and Java version 1.5 or later, preferably 1.7.0_04. If you can’t see the prices in your local currency, Troubleshoot
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 Redistributables
Microsoft C++ Keywords Costs
Microsoft C++ sizeof Books
C/C++ Header Libraries Links
Compiling

Differences between C++ and Java

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), but it works at a higher level of abstraction.

The major differences between C++ and Java are:

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 (Institute of Electrical & Electronics Engineers) 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 roughly contain:
Common C/C++ header files
Header Contents
afx.h includes Windows API and common C headers too.
afxcmn.h MFC (Microsoft Foundation Classes) 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 (Disk Operating System) API
fcntl.h open flags: O_RDONLY, _O_CREAT, _O_EXCL
io.h _chsize, _chmod, _lseek
jni.h Java JNI (Java Native Interface) 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

MS Visual C++ Express 2010 aka Visual is free, but you might ask you to register, and you must use the IE (Internet Explorer) browser to do it. They ask you a ton of questions. The free version cannot generate 64-bit code, though I have heard you can kludge it by downloading the MS SDK (Software Development Kit) and running it from the command line. Visual Studio Pro (the cheapest version that can still generate 64-bit) will set you back $480.00 USD . I found the iso-image version (which includes various other languages) oddly installed more quickly overall since it does not need to download code during the install. It has a bug. You must arrange to put Program Files (x86)\Microsoft Visual Studio 10.0\Common7\ide\mspdb100.dll on the path. You can run X:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat to patch the environment to fix the problem. It inserts all manner of set parameters and adds many directories to your path. The normal Windows Update process updates Visual Studio 10.0.

You most commonly want to configure your project as a console application without precompiled headers. When you use the GUI, the most interesting options are in right click properties for both the project and source files.
You will normally want to right click Project Properties ⇒ General ⇒ Use of MFC ⇒ Use MFC in a Static Library
You will normally want to right click Project Properties ⇒ C++ ⇒ Precompiled Headers ⇒ Not using precompiled headers.
Sometimes it is easier to edit the *.vcxproj files with a text editor. It can be so hard to find the dialog in the GUI to control a field.
Right click Project Properties ⇒ C++ ⇒ General and set it to F:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include;C:\Program Files (x86)\Microsoft SDK s\Windows\v7.0A\Include;E:\Program Files (x86)\Java\jdk1.7.0_04\include;E:\Program Files (x86)\Java\jdk1.7.0_04\include\win32 to ensure JNI works.

The command line equivalents to your GUI options should look something like this for debug:

Microsoft C++ Express cl.exe Command Line Options
Debug Release Notes
/Od /O2 debug or optimise for speed
/Oi intrinsic functions
/GL link time optimisation
/D "WIN32" /D "WIN32" 32-bit windows app
/D "_DEBUG" /D "NDEBUG" debugging on not
/D "_CONSOLE" /D "_CONSOLE" command line, console app
/D "_UNICODE" /D "_UNICODE" no multibyte sequences
/D "UNICODE" /D "UNICODE" no multibyte sequence
/EHsc /EHsc Enable C++ exceptions
/RTC1 run time checks
/MTd /MT multi-thread library
/Gy function level linking
/Fo"Debug\\" /Fo"Release\\" where to put the object modules
/Fd"Debug\vc90.pdb" /Fd"Release\vc90.pdb" Program database
/W3 /W3 warning level
/Y- /Y- inhibit precompiled headers
/nologo /nologo no startup banner
/c /c compile without linking
/Zi Debug format
/TP /TP compile as C++
/errorReport:prompt /errorReport:prompt prompt immediately
Microsoft Link link.exe Command Line Options
Debug Release Notes
/OUT:"E:\com\mindprod\splice\Debug\splice.exe" /OUT:"E:\com\mindprod\splice\Release\splice.exe" where exe file is generated
/INCREMENTAL:NO /INCREMENTAL:NO no incremental linking
/NOLOGO /NOLOGO no startup banner
/MANIFEST:NO /MANIFEST:NO no manifest
/DEBUG debug or release
/PDB:"E:\com\mindprod\splice\Debug\splice.pdb" Program database
/SUBSYSTEM:CONSOLE /SUBSYSTEM:CONSOLE command line console app
/OPT:REF optimise by removing unreferenced code
/OPT:ICF optimise by removing redundant ICFs
/LTCG link time code generation
/DYNAMICBASE /DYNAMICBASE randomised image base
/NXCOMPAT /NXCOMPAT DEP compatible
/MACHINE:X86 /MACHINE:X86 Windows hardware
/ERRORREPORT:PROMPT /ERRORREPORT:PROMPT display errors immediately
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libraries

/FD means incremental rebuild. It is not a real command line option. You can safely delete compiler intermediate files: *aps *.ilk *.ipch *.ncb *.pbd *.pch. You must keep the *.sln *.suo *.vcproj *.user.

For command line use, you also need SET environment variables to help the compiler find the include libraries and the linker find the object libraries.

Redistributables

Microsoft Visual C++ needs a run time library called a redistributable package installed on the client machine. Alternatively you can create standalone exe files.
C++ 2010 64 bit
C++ 2010 32 bit
C++ 2008 64 bit
C++ 2008 32 bit

Costs

Books

book cover recommend book⇒C++ For Java Programmers
by:Mark Allen Weiss 978-0-201-61246-2paperback
publisher:Addison Wesley
published:1999-04-02
This is the same title as Timothy A. 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.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒C++ For Java Programmers
by:Timothy A. Budd 978-0-13-919424-5paperback
publisher:Prentice Hall 978-0-13-919424-5hardcover
published:2003-11-07
This is the same title as Mark Allen Weiss’s book. Note the direction. ost 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.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒Beginning Visual C++ 6
by:Ivor Horton 978-1-86100-088-0paperback
publisher:Wrox
published:1998-08
A gentle, easy-paced introduction to C++.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒Accelerated C++: Practical Programming by Example
by:Andrew R. Koenig, Barbara E. Moo 978-0-201-70353-5paperback
 (born: 1952 age: 59) 978-0-613-92046-9hardcover
publisher:Addison-Wesley
published:2000-08-24
Recommended for people who know Java and want to learn C++.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒The Design and Evolution of C++
by:Bjarne Stroustrup 978-0-201-54330-8paperback
 (born: 1950-12-30 age: 61)
publisher:Addison-Wesley
published:1994-04-08
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.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒The C++ Programming Language, third edition
by:Bjarne Stroustrup 978-0-201-88954-3paperback
 (born: 1950-12-30 age: 61) 978-0-201-70073-2hardcover
publisher:Addison-Wesley
published:1997-06-30
A reference manual for C++, rather formal. fourth edition due 2013-01-04.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒The Annotated C++ Reference Manual
by:Margaret A. Ellis, Bjarne Stroustrup 978-0-201-51459-9paperback
publisher:Addison-Wesley
published:1990-01-11
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.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock
book cover recommend book⇒Java Programming: Making the Move from C++
by:Joe Wigglesworth and Paula Lumby 978-1-85032-922-0paperback
publisher:International Thomson Computer
published:1998-07-21
Does not discuss anything past Java 1.1.
Australian flag abe books anz abe books.co.uk UK flag
German flag abe books.de amazon.co.uk UK flag
German flag amazon.de abe books.ca Canadian flag
Spanish flag iberlibro.com amazon.ca Canadian flag
Spanish flag amazon.es Chapters Indigo Canadian flag
French flag abe books.fr abe books.com American flag
French flag amazon.fr amazon.com American flag
Italian flag abe books.it Barnes & Noble American flag
Italian flag amazon.it Powells American flag
American flag O’Reilly Safari Sony e-books American flag
Kobo UN flag
Greyed out stores probably do not have the item in stock

CMP homejump to top You can get the freshest 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
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.210]
You are visitor number 17,123.