Monday, February 8, 2010

comp.lang.c++ - 25 new messages in 6 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* C++ Workshop Announcement from the NYLUG and NYLXS Mailing Lists - 1
messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/5899d52668535101?hl=en
* int (*&)() - 7 messages, 4 authors
http://groups.google.com/group/comp.lang.c++/t/889d2547688e2155?hl=en
* Motivation of software professionals - 11 messages, 7 authors
http://groups.google.com/group/comp.lang.c++/t/21a3fdec4dd53e6a?hl=en
* B const * array[ ] in gobal - 4 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/539f80e07ceb283b?hl=en
* Loop generates never-ending sockets and threads, need help debugging - 1
messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/bfb43e94d5fe70d1?hl=en
* MultiCharts 5.5 warez download - www.top-tradesoft.com - 1 messages, 1
author
http://groups.google.com/group/comp.lang.c++/t/3763c155c0ef3f5a?hl=en

==============================================================================
TOPIC: C++ Workshop Announcement from the NYLUG and NYLXS Mailing Lists
http://groups.google.com/group/comp.lang.c++/t/5899d52668535101?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Feb 8 2010 12:10 am
From: Ruben Safir

C++ Syntax

Before exploring how we actually represent data in our C++ programs, I
want to introduce a formal discussion of basic C++ syntax, which, like
data types, doesn't get enough attention in most standardized texts.

All programming languages require syntax rules in order for the
compilers, to parse and create working machine code. These syntax rules
require basic understanding of core components. These components include
files, structure, statements, data and operators.

Starting from the top, first you have files, and files usually have naming
rules. C++ inherits from C nearly all the file structures, and actually
requires a greater knowledge in more detail and at an earlier level of
expertise. C++, because of its object oriented design depends heavely on
library creation. In fact, even for beginners, most of your work happens
on the library level.

All C programs inherit from the Unix enviroment, which co-developed with
C, the need for an initiation of the main function definition. All C
programs start with main, and main will then absorb and use all other
parts of the systems libraries and programming to produce your completed
program. Main is located in your upper most programming file.

Standard Programming Files: A standard programming file is when the top
most programming will take place. In the C language, most of your code,
espeically as a beginner takes place in this file. Most commonly these
files have a suffix of either .cc oro .C. file.C for example is a
standard C++ File name.

A standard programming file will have several components:

1) Include Prepocessor Directives - These import header files and define
the definitions of the symbols which your not spontaneously creating,
that your program will use.

And include directive might look like this:

#include <iostream>

Which tells the compiler to load up the defintions of all the functions
and objects defined in the iostream library.

Standard C++ libraries are included using the angle blacket notions as
above.They are search for by your compiler in a set of standard locations
which are defined by your compiler and programming enviroment (something
I wouldn't mind understanding better on modern Linux and GNU enviroments).

If you use the syntax

#include "myheader"

with double quotes, the compiler will look for these headers in the local
directory.

C libraries are accessable in C++ and can either have a standard C
language notion

#include <assert.h>
#include <stdio.h>
***Note the .h suffix being included***
or use the C++ version

#include <casset>
#include <cstdio>


2) Macro and other Prepocessor Compiler Directives - Help set up
conditions in which libraries and header files are brought into your
program to help prevent duplication and to create different versions of
a program as might be needed for differing architecture or conditions.

The list of Preprocessor Directives are as follows:
#define

No comments: