|FROM ||Ruben Safir
|SUBJECT ||Subject: [NYLXS - HANGOUT] C++ Workshop I datatypes cont..
|From owner-hangout-outgoing-at-mrbrklyn.com Fri Feb 5 02:08:04 2010
Received: by www2.mrbrklyn.com (Postfix)
id 925629C21B; Fri, 5 Feb 2010 02:08:04 -0500 (EST)
Received: by www2.mrbrklyn.com (Postfix, from userid 28)
id 7F3A79C237; Fri, 5 Feb 2010 02:08:04 -0500 (EST)
Received: from mail2.panix.com (mail2.panix.com [220.127.116.11])
by www2.mrbrklyn.com (Postfix) with ESMTP id 1CEB99C21B
for ; Fri, 5 Feb 2010 02:08:04 -0500 (EST)
Received: from panix1.panix.com (panix1.panix.com [18.104.22.168])
by mail2.panix.com (Postfix) with ESMTP id 6B0C238E48
for ; Fri, 5 Feb 2010 02:10:17 -0500 (EST)
Received: by panix1.panix.com (Postfix, from userid 20529)
id 5D9F314B9A; Fri, 5 Feb 2010 02:10:17 -0500 (EST)
Date: Fri, 5 Feb 2010 02:10:17 -0500
From: Ruben Safir
Subject: [NYLXS - HANGOUT] C++ Workshop I datatypes cont..
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.5.18 (2008-05-17)
References in general programming, is a symbolic variable that points
to a data structure which is addressed by another symbolic variable,
and has some syntax in order to allow the reference to act like the
original variable. But references don't directly store the original
data structure, just the needed instructions to go find the data in RAM.
All programming languages need to keep track of the symbols in it
running program, and the addresses that the symbols are associated
with, in order to retrieve data from those addresses. In Perl, the
language has such a symbols table built into its runtime environment.
Easy direct access to entries in the look up table is a key reason why
Perl is such a flexible and simple language.
In C programming there are no references (although it has a look up
table as was shown in the first entry of this workshop using nm on a
C binary). There are, however, pointers, which store RAM addresses and
allow indirect access to data structures. C++ adds a formal reference,
although it is not a very flexible reference syntactically. In C++,
if you create a symbolic variable of some data type which is assigned
data, you can create a reference to that variable which acts just like
the variable itself. But like a pointer, a reference stores an address,
not the data. And in that regard, it's syntax is difference. And we'll
see that soon. References in C++ are also called Aliases. A reference
creates an alias to an existing variable. A reference cannot be created
without assigning it to an existing data structure.
Functions or Methods: Functions are a symbolic variable that store
Code is a data type, although you'll rarely hear it discussed as such.
The most important function in Unix and C++ is main(). All programs
must have main(). Functions are stored in RAM and pointers can point
at them by storing that address.
OK Done with Data Types. Next we start with Data Creation and syntax.
First we will discuss data creating and storage syntax, and then
afterwards we will take a formal look at general C++ syntax rules,
Keywords, and built in operators.