bc9Basic Loves c++
One of my primary interests with bc9Basic is to increase my knowledge of c++.
To that end I have added or tweaked a number of items to help produce modern c++ code.
In the help file, with the permission of the original author Eric Brasseurthere, is an abridged C++ Tutorial for bc9Basic/BCX Users: "The C++ tutorial for C users"
I will start with these entries and then add my own additions.
The three c++ compilers that I use and test.
Visual Studio 2015 Commnity:
https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspxTDM-GCC :
http://tdm-gcc.tdragon.net/Nuwen :
http://nuwen.net/mingw.htmlThe comments "'Translate with ..." in the examples refer to the pulldown options in the bc9Adp2 Ide.
Using the included unicode lexer app, ULEX, the demos can be translated to source for compiling as a Unicode application.
The $NOMAIN directive tells the translator we will be providing our own main() function. This is my preferred method.
There are a number of ways to dimension variables that you may notice in the demos. While the translator supports them, I do not use suffixes.
Local may be substituted for Dim
Dim As Integer i
Dim i As Integer
Dim As Integer i,j,k
These all initialize the variable(s) to {0} in the c++ source: int i = {0};
If you substitute Raw for Dim there is no initialization you get: int i;
You can also assign a value in the Dim/Local/Raw:
Dim As Integer i = 7 -> int i = 7;
See the help file for more information on DIM
James
Edit: added zip of examples