View topic - include# <iostream.h> - Afghan Forum -


include# <iostream.h>
Goto page Previous  1, 2, 3
Afghan Forum Forum Index -> Postings on your Homepage

  Author    Thread Post new topic Reply to topic
System



Joined: 02 Apr 2004
Posts: 0
Advertisement

Post 15.03.2006 00:28:29 
  Send private message   Reply with quote  
nadia007
Bronzemitgliedschaft


Joined: 10 Oct 2005
Posts: 100
Location: Germany, Frankfurt (Hessen)

Hi, i just wanted to post something on my homepage and i didn’t know what so I wrote the programming code: #include. Iit is not a “007Code” or 007 Mission lolll.

Maryam jan qand Programming is really complicated and I can not understand it so easy too lolll so I tried to find some infos about this topic I hope its helpfull.

Programming language

If you are knowledgable about this topic, help  me by improving the article.

A programming language or computer language is a standardized communication technique for expressing instructions to a computer. It is a set of syntactic and semantic rules used to define computer programs. A language enables a programmer to precisely specify (but see Genetic Programming) what data a computer will act upon, how these data will be stored/transmitted, and what actions will be taken under various circumstances.

Contents

Features of programming language

Each programming language can be thought of as a set of formal specifications concerning syntax, vocabulary, and meaning.

These specifications usually include:

Most languages that are widely used, or have been used for a considerable period of time, have standardization bodies that meet regularly to create and publish formal definitions of the language, and discuss extending or supplementing the already extant definitions.

Data types

Internally, all data in modern digital computers are stored simply as zeros or ones (binary). The data typically represent information in the real world such as names, bank accounts and measurements and so the low-level binary data are organized by programming languages into these high-level concepts.

The particular system by which data are organized in a program is the type system of the programming language; the design and study of type systems is known as type theory. Languages can be classified as statically typed languages, and dynamically typed languages. Statically typed languages can be further subdivided into languages with manifest types, where each variable and function declaration has its type explicitly declared, and type-inferred languages. It is possible to perform type inference on programs written in a dynamically typed language, but it is entirely possible to write programs in these languages that make type inference infeasible. Sometimes dynamically typed languages are called latently typed.

With statically typed languages, there usually are pre-defined types for individual pieces of data (such as numbers within a certain range, strings of letters, etc.), and programmatically named values (variables) can have only one fixed type, and allow only certain operations: numbers cannot change into names and vice versa. Most mainstream statically typed languages, such as C, C++, C#, Java and Delphi, require all types to be specified explicitly; advocates argue that this makes the program easier to understand, detractors object to the verbosity it produces. Type inference is a mechanism whereby the type specifications can often be omitted completely, if it is possible for the compiler to infer the types of values from the contexts in which they are used -- for example, if a variable is assigned the value 1, a type-inferring compiler does not need to be told explicitly that the variable is an integer. There are however many different uses for integers; it might e.g. make sense in a program to prevent inadvertent adding of a phone number to the number of apples in a box. Therefore some languages such as Ada allow defining different kinds of incompatible integers; this is called strong typing. Type-inferred languages can be more flexible to use, particularly when they also implement parametric polymorphism. Examples of type-inferring languages are Haskell, MUMPS and ML.

Dynamically typed languages treat all data locations interchangeably, so inappropriate operations (like adding names, or sorting numbers alphabetically) will not cause errors until run-time -- although some implementations provide some form of static checking for obvious errors. Examples of these languages are APL, Objective-C, Lisp, Smalltalk, JavaScript, Tcl, Prolog, Python, and Ruby.

Strongly typed languages do not permit the usage of values as different types; they are rigorous about detecting incorrect type usage, either at runtime for dynamically typed languages, or at compile time for statically typed languages. Ada, Java, ML, and Oberon are examples of strongly typed languages.

Weakly typed languages do not strictly enforce type rules or have an explicit type-violation mechanism, often allowing for undefined behavior, segmentation violations, or other unsafe behavior if types are assigned incorrectly. C, assembly language, C++, and Tcl are examples of weakly typed languages.

Note that strong vs. weak is a continuum; Java is a strongly typed language relative to C, but is weakly typed relative to ML. Use of these terms is often a matter of perspective, much in the way that an assembly language programmer would consider C to be a high-level language while a Java programmer would consider C to be a low-level language.

Note that strong and static are orthogonal concepts. Java is a strongly, statically typed language. C is a weakly, statically typed language. Python is a strongly, dynamically typed language. Tcl is a weakly, dynamically typed language. But beware that some people incorrectly use the term strongly typed to mean strongly, statically typed, or, even more confusingly, to mean simply statically typed--in the latter usage, C would be called strongly typed, despite the fact that C doesn't catch that many type errors and that it's both trivial and common to defeat its type system (even accidentally).

Aside from when and how the correspondence between expressions and types is determined, there's also the crucial question of what types the language defines at all, and what types it allows as the values of expressions (expressed values) and as named values (denoted values). Low-level languages like C typically allow programs to name memory locations, regions of memory, and compile-time constants, while allowing expressions to return values that fit into machine registers; ANSI C extended this by allowing expressions to return struct values as well (see record). Functional languages often restrict names to denoting run-time computed values directly, instead of naming memory locations where values may be stored, and in some cases refuse to allow the value denoted by a name to be modified at all. Languages that use garbage collection are free to allow arbitrarily complex data structures as both expressed and denoted values.

Finally, in some languages, procedures are allowed only as denoted values (they cannot be returned by expressions or bound to new names); in others, they can be passed as parameters to routines, but cannot otherwise be bound to new names; in others, they are as freely usable as any expressed value, but new ones cannot be created at run-time; and in still others, they are first-class values that can be created at run-time.

Data structures

Most languages also provide ways to assemble complex data structures from built-in types and to associate names with these new combined types (using arrays, lists, stacks, files).

Object oriented languages allow the programmer to define data-types called "Objects" which have their own intrinsic functions and variables (called methods and attributes respectively). A program containing objects allows the objects to operate as independent but interacting sub-programs: this interaction can be designed at coding time to model or simulate real-life interacting objects. This is a very useful, and intuitive, functionality. Languages such as Python and Ruby have developed as OO (Object oriented) languages. They are comparatively easy to learn and to use, and are gaining popularity in professional programming circles, as well as being accessible to non-professionals. It is commonly thought that object-orientation makes languages more intuitive, increasing the public availability and power of customized computer applications.

Instruction and control flow

Once data has been specified, the machine must be instructed how to perform operations on the data. Elementary statements may be specified using keywords or may be indicated using some well-defined grammatical structure.

Each language takes units of these well-behaved statements and combines them using some ordering system. Depending on the language, differing methods of grouping these elementary statements exist. This allows one to write programs that are able to cover a variety of input, instead of being limited to a small number of cases. Furthermore, beyond the data manipulation instructions, other typical instructions in a language are those used for control flow (branches, definitions by cases, loops, backtracking, functional composition).

Design philosophy

For the above-mentioned purposes, each language has been developed using a special design or philosophy. Some aspect or another is particularly stressed by the way the language uses data structures, or by which its special notation encourages certain ways of solving problems or expressing their structure.

Since programming languages are artificial languages, they require a high degree of discipline to accurately specify which operations are desired. Programming languages are not error tolerant; however, the burden of recognizing and using the special vocabulary is reduced by help messages generated by the programming language implementation. There are a few languages which offer a high degree of freedom in allowing self-modification in which a program re-writes parts of itself to handle new cases. Typically, only machine language, Prolog, PostScript, and the members of the Lisp family (Common Lisp, Scheme) provide this capability. In MUMPS language this technique is called dynamic recompilation; emulators and other virtual machines exploit this technique for greater performance.

Compilation and interpretation

There are, broadly, two approaches to execute a program written in a given language. These approaches are known as compilation, done by a program known as a compiler; and interpretation, done by an interpreter. Some programming language implementations support both interpretation and compilation.

An interpreter parses a computer program and executes it directly. One can imagine this as following the instructions of the program line-by-line. In contrast, a compiler translates the program into machine code -- the native instructions understood by the computer's processor. The compiled program can then be run by itself.

Compiled programs usually run faster than interpreted ones, because the overhead of understanding and translating the programming language syntax has already been done. However, interpreters are frequently easier to write than compilers, and can more easily support interactive debugging of a program.

History of programming languages

The development of programming languages, unsurprisingly, follows closely the development of the physical and electronic processes used in today's computers.

Programming languages have been under development for years and will remain so for many years to come. They got their start with a list of steps to wire a computer to perform a task. These steps eventually found their way into software and began to acquire newer and better features. The first major languages were characterized by the simple fact that they were intended for one purpose and one purpose only, while the languages of today are differentiated by the way they are programmed in, as they can be used for almost any purpose. And perhaps the languages of tomorrow will be more natural with the invention of quantum and biological computers.

Charles Babbage is often credited with designing the first computer-like machines, which had several programs written for them (in the equivalent of assembly language) by Ada Lovelace.

In the 1940s the first recognizably modern, electrically powered computers were created. Some military calculation needs were a driving force in early computer development, such as encryption, decryption, trajectory calculation and massive number crunching needed in the development of atomic bombs. At that time, computers were extremely large, slow and expensive: advances in electronic technology in the post-war years led to the construction of more practical electronic computers. At that time only Konrad Zuse imagined the use of a programming language (developed eventually as Plankalkül) like those of today for solving problems.

Subsequent breakthroughs in electronic technology (transistors, integrated circuits, and chips) drove the development of increasingly reliable and more usable computers. The first widely used high level programming language was Fortran, developed during 1954–57 by an IBM team led by John W. Backus. It is still widely used for numerical work, with the latest international standard released in 2004. A Computer Languages History graphic shows a timeline from Fortran in 1954.

Dennis Ritchie and Brian Kernighan developed the C programming language, initially for DECPDP-11 in 1970. Later with lead of Bjarne Stroustrup the programming language C++ appeared in 1985 as an Object oriented language vertically compatible with C. Sun Microsystems released Java in 1995 which became very popular as an introductory programming language taught in universities. Microsoft presented the C# programming language in 2001 which is very similar to C++ and Java. There are many, many other languages (cf. List of programming languages).

Classifications of programming languages

Formal semantics

The rigorous definition of the meaning of programming languages is the subject of formal semantics.

See also

Category:Programming languages

Wikipedia, the free encyclopedia.

http://en.wikipedia.org/wiki/Programming_language

http://cgibin.erols.com/ziring/cgi-bin/cep/cep.plhttp://cgibin.erols.com/ziring/cgi-bin/cep/cep.pl?_usersearch=1&_usertab=1&_search=iostream&_searchfield=.&_format=full

A programming Language

C++

Language type:

O - Object-oriented

Description:

C++ is a fairly complicated object-oriented language derived from C. The syntax of C++ is a lot like C, with various extensions and extra keywords needed to support classes, interitance and other OO features. C++ was originally developed as an extension to C, but quickly evolved into its language. Despite some of the flaws it has inherited from C, C++ is a very popular language for application development on Unix systems and PCs.
The C++ programming language offers a very broad range of OOP features: multiple inheritance, strong typing, dynamic memory management, templates (generics), polymorphism, exception handling, and overloading. Some newer C++ systems also offer run-time type identification and separate namespaces.
C++ also supports the usual features expected of an application language: a variety of data types including strings, arrays and structures, full I/O facilities, data pointers and type conversion. The C++ Standard Template Library (STL) offers a set of collection and abstract data type facilities.
Because it is derived from C, C++ has a number of features that support unsafe and defective software. The more recent C++ standards do support safe casts, but this feature is not yet universally available or employed. Also, C++ has dynamic memory allocation, but does not have garbage collection; this allows programs to mis-use and leak memory. C++ also supports dangerous raw memory pointers and pointer arithmetic. These low-level facilities are useful in some situations, but can increase the time needed for software development.
Efforts at unifying the C++ language were begun in 1989. C++ was finally standardized by the ISO and ANSI in November, 1997.
Information on C++ is widely available on the WWW, but language has no official home on the Web. Many C++ implementations exist, some of them follow the old tradition of translating C++ into C, while others are native compilers. A few free C++ compilers exist, the most notable of which is the GNU C/C++ compiler, GCC.

Origin:

Bjarne Stoustrup, AT&T Bell Labs, 1982-85.

See Also:

C    Objective-C    Ada    Eiffel   

Remarks:

C++ is one of the most popular programming languages available today; in 1997 it was estimated that 1.5 million people knew how to write C++ code. The language is popular for several reasons:

o      it is pragmatic

o      it is powerful

o      it resembles C which was also very popular

o      it is used to write system and application programs for UNIX and MS-Windows,

o      good compilers for it are available both for free and commercially

o      there are plenty of good books about it available


C++ is one of the most mature and certainly the most widely-implemented object-oriented language. Even so, it is missing some features that are considered obligatory in a new OOP language design: concurrency, persistence, automatic garbage collection, and reflection. In exchange for these deficiencies, C++ gives some things that system programmers especially like: determinism and control. Because very little need happen behind the scenes in C++ programs, they have low overhead and good performance.
C++ has a number of notable features that make it powerful, but which make it easy to write undecipherable unmaintainable programs. First, it supports operator overloading for almost every operator in the language, include [] and () and and ->. Second, it support raw pointers. Third, it supports both implicit and explicit type conversions, both built-in and programmer-defined. Fourth, it supports the C macro preprocessor. Fifth, it allows the programmer to control the degree of data hiding enforced by object classes. Taken together, these features offer the programmer the ability to do great things, and but the potential for writing really awful code A wide variety of add-on libraries and utilities for C++ developers are available. Good compilers are available for all platforms.

Links:

C++ Report magazine

The ISO/ANSI C++ Standard

Ask the C++ Pro

C++ FAQ lists

Yahoo! C/C++ resources

Sample code:

// This is just a placehold until I write a 
// better example.
 
#include 
#include 
main(int argc, char *argv[]) 
{
        String *s1;
        s1 = new String("Hello World!");
        cout << *s1 << endl << "Length is:" << s1->length() << endl;
}
 


_________________
salam Hamwatanan

Last edited by nadia007 on 29.11.2005 13:28:27, edited 1 time in total

Post 29.11.2005 12:31:19 
  Send private message Visit posters website   Reply with quote  
nadia007
Bronzemitgliedschaft


Joined: 10 Oct 2005
Posts: 100
Location: Germany, Frankfurt (Hessen)
An example

It’s an example programm from programming Language C++. After this programm has successfully compiled, Now let's take a look at each line of code so that you have a general understanding of how the program works. It will probably look confusing if you've never seen C++ syntax before, but that's completely natural.

Here's the program again:

//include this file for cout
#include <iostream.h>
 
int main() {
 
  //print out the text string, "Hello, World!"
  cout << "Hello, World!" << endl;
 
  return 0;
 
}

Let's take a look at each line of code that makes up hello.C.

//include this file for cout

This line is a comment line. The // indicates that everything following it should be ignored by the compiler. This allows you to add English explanations to what might otherwise be confusing code. You have the freedom to comment your code as much as you like -- some programmers write code with no comments at all; others write several lines of comments for each line of C++ code. It's all up to you. Keep in mind, though, that if anyone else will ever read your code, you'll probably want to add comments. Even if you are the only one who will ever read your code, you should add comments. It sounds implausible, but programmers often don't understand code they've written weeks ago!

#include <iostream.h>

This line is read "pound include i-o-stream dot h". The effect of this line is to essentially "copy and paste" the entire file iostream.h into your own file at this line. So you can think of this syntax as replacing the line #include <iostream.h> with the contents of the file iostream.h. #include is known as a preprocessor directive, which will be covered much later.

Where is the file iostream.h?
This file is located somewhere in your include
path. The include path indicates the directories on your computer in which to search for a file, if the file is not located in the current directory.

Why do I need to include iostream.h?
In this case,
iostream.h is a file containing code for input/output operations. You need to include iostream.h so that the compiler knows about the word cout, which appears a couple of lines below.

int main() {

Every C++ program must have what is known as a main function. When you run the program, the program will go through every line of code in the main function and execute it. If your main is empty, then your program will do nothing.

There are essentially four parts to a function definition. They are the return type, the function name, the parameter list, and the function body, in that order. In this case:

  • return type: int
  • function name: main
  • parameter list: ()
  • function body: { ... }

For now, the important thing to remember is that the function body is the part enclosed in { ... } ("curly braces"). The { indicates the beginning of the function, and the } indicates the end of the function. The function body is the stuff in between.

//print out the text string, "Hello, World!"

Another comment line. Remember, the compiler ignores anything following // (up until the end of the line), so you can say whatever you want on these lines.

cout << "Hello, World!" << endl;

This is the line that prints out the text string, "Hello, World!". For now, don't worry about how cout works, just know how to use it. You can print out any series of text strings by separating them with <<. So, instead of saying cout << "Hello, World!" << endl;, you could say cout << "Hello, " << "World" << "!" << endl;. The endl simply adds a carriage return (stands for "end-line").

return 0;

This line is necessary because the return type of main is int (see above). We'll talk more about functions and return types later, but for now understand that because the function's return type is int, the function must return an int (integer). To return 0 (which is an integer, we simply write return 0;.

 

Glossary

algorithm

A series of steps that systematically outline how to accomplish a goal.

assembler

a piece of software that translates a specific assembly language into machine language for a specific processor.

assembly language

a set of instructions that a programmer can use to create a program for use on a specific processor. Assembly language is translated into machine language by a piece of software called an assembler

 

bit

The smallest possible unit of memory. A bit can store only two different values - a "0" or a "1". If a bit could store only one possible value, it would not store any information at all, because each bit would look identical. However, a bit storing one of two possible values can be combined with lots of other bits to store huge quantities of information. The term for a group of eight bits, a common occurrence, is called a byte.

byte

A small unit of memory. A byte is composed of eight bits. One bit can store two different combinations (0 or 1), two bits can store four different combinations (00, 01, 10, 11), three bits can store eight different combinations (000, 001, 010, 011, 100, 101, 110, 111); following the pattern, eight bits, or one byte, can store 256 different values.

casting

The act of viewing (and often converting) the information contained in a variable of one type as if that information was of another type.

comment

These are put into source code by programmers in order to better explain what the code does. When source code is compiled into assembly language, all comments are removed. Comments only describe code, there is no action associated with them. Since comments are removed by the compiler, they can be written in plain English (or any other natural language you choose!).

compiled

Once third-generation languages have been translated into assembly code and then to machine code, they are said to have been compiled. Loosely, this could also be used to refer to any single intermediate step.

compiler

a piece of software that takes third-generation language code and translates it into a specific assembly code. Compilers can be quite complicated pieces of software.

constructor

...

cout

In the C++ language, this is the name given to the standard output stream. When a buffer of characters is sent to this stream, they will appear as output on the terminal the program was ran from.

debug

the act of removing errors, logical mistakes, or flow of control problems in a program.

decimal

a number represented as a whole number and some fractional part as well. Decimal numbers either take up more memory than integers, or are accurate to less places, or both.

execute

The act of starting up and running a certain program. This involves loading the program from disk into main memory, reserving memory space for the program to work with, and sequentially executing the steps of the program as outlined by the programmer

function

...

garbage

an all-encompassing term used to denote variable values that are undefined, or bad input into a program.

 

gcc

this is the name of the gnu C++ compiler. This free compiler is frequently used on machines running the UNIX operating system. The latest version of gcc can be downloaded via ftp.

instruction set

a set of commands that a certain CPU understands. These are very basic instructions that are wired into the logic of the CPU.

integer

a whole number value. In programming languages, integers also have a maximum value, depending on the language definition or the architecture of the machine that the code is compiled on

keyword

a word that has some sort of predefined meaning in the context of a programming language

machine language

a processor specific set of binary codes that correspond to actions to be taken by the processor of a machine.

main

In C++, this is the first function that is called when a program is executed. When a program returns from main, execution has been completed.

object

...

operator

Acts on one or more subexpressions to produce a value.

parameter

a piece of data that is passed into a program, subroutine, or function call.

path

A path is used to specify where certain files can be found in a directory tree. Sometimes path is used to mean where an application looks to find certain files, such as "make sure stdio.h is in your path, or the compiler won't find it."

portable

a description of how easy it is to take code written on one machine or system and correctly compile it on another machine or system. This process is called "porting".

preprocessor directive

a command placed within a source code listing, that directs the compiler to do something before the rest of the source code is parsed and compiled.

pseudo-code

a high-level abstraction of code, usually used to outline the general steps in an algorithm without having to write actual code (usually done for the reader's or programmer's benefit). 

return type

specifies the type of data that is returned from a function call.

type

describes what sort of information a variable stores, as well as how much space that information takes up.

UNIX

A multi-processing, multi-user, family of operating systems that run on a variety of architechtures. A shareware version of this operating system, Linux, runs on the IBM compatible PC.

variable

a name, given by a programmer, to represent a piece of data within a certain program. This name is then used to refer to that piece of data.

Windows

A family of operating systems created by Microsoft, that run on Intel based IBM compatible machines.


_________________
salam Hamwatanan

Post 29.11.2005 12:33:55 
  Send private message Visit posters website   Reply with quote  
Temoryan
Forum-Admin


Joined: 07 Jul 2005
Posts: 4425
Location: Munich

very nice nadia ;-)))

U know what I had to learn all of them and I had to pass 3 exams about c, c++ and VHDL at university ;-)))
If someone need details information I will be there ;-)

Post 29.11.2005 12:35:44 
  Send private message Visit posters website   Reply with quote  
nadia007
Bronzemitgliedschaft


Joined: 10 Oct 2005
Posts: 100
Location: Germany, Frankfurt (Hessen)

ja stimmts ich kann dich sehr gut verstehen. das ganze geht mir manchmal auf die Nerven! loll


_________________
salam Hamwatanan

Post 12.12.2005 18:24:56 
  Send private message Visit posters website   Reply with quote  
mahdi26
Aktives Mitglied


Joined: 24 Oct 2005
Posts: 5
Location: Germany, Darmstadt

very nice sweety, aferin qandem

Post 12.12.2005 18:55:51 
  Send private message Visit posters website   Reply with quote  
  Display posts from previous:      
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

Last Thread | Next Thread  >


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB enhanced by us © 2001, 2002 phpBB Group

Datenschutz | AfghanMania.com | AfghanMania.de | AfghanMania.com.af | Afghan Press
Afghan Postcards | Afghan New | Afghan Music | Afghan Info | Afghan Dictionary
Sport: Iran incessant