C C For Beginners Crash Course Master C Programming Fast And Easy Today Computer Programming Programming For Beginners Book 2 Raj Ali Prx Publishings pdf download
C C For Beginners Crash Course Master C Programming Fast And Easy Today Computer Programming Programming For Beginners Book 2 Raj Ali Prx Publishings pdf download
C For Beginners Crash Course Master C Programming Fast And Easy Today
1st Edition Raj Ali
https://ebookbell.com/product/c-for-beginners-crash-course-master-c-
programming-fast-and-easy-today-1st-edition-raj-ali-6769226
https://ebookbell.com/product/c-programming-for-beginners-the-
complete-crash-course-to-mastering-c-on-your-own-1st-megane-
noel-47525570
https://ebookbell.com/product/learn-c-for-beginners-by-ahmad-
ibrahim-1st-edition-ahmad-ibrahim-38180618
https://ebookbell.com/product/python-c-for-beginners-black-dog-
media-33573218
Modern C For Absolute Beginners A Friendly Introduction To The C
Programming Language And C11 To C23 Standards 2nd Edition 2nd Edition
Slobodan Dmitrovi
https://ebookbell.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-the-c-programming-language-
and-c11-to-c23-standards-2nd-edition-2nd-edition-slobodan-
dmitrovi-48278302
https://ebookbell.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-c-programming-language-
and-c11-to-c20-standards-1st-edition-slobodan-dmitrovi-50195194
https://ebookbell.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-c-programming-language-
and-c11-to-c20-standards-1st-edition-slobodan-dmitrovi-11279558
https://ebookbell.com/product/c-for-beginners-the-tactical-guidebook-
learn-csharp-by-coding-jonas-fagerberg-11124210
https://ebookbell.com/product/c-for-beginners-masters-asthana-a-
asthana-r-g-s-1407664
C#
FOR BEGINNERS
CRASH COURSE
Master C# Programming
Fast and Easy Today
By
RAJ ALI
© Copyright 2014 - All rights reserved.
In no way is it legal to reproduce, duplicate, or transmit any part of this document in
either electronic means or in printed format. Recording of this publication is strictly
prohibited and any storage of this document is not allowed unless with written
permission from the publisher. All rights reserved.
The information provided herein is stated to be truthful and consistent, in that any
liability, in terms of inattention or otherwise, by any usage or abuse of any policies,
processes, or directions contained within is the solitary and utter responsibility of the
recipient reader. Under no circumstances will any legal responsibility or blame be
held against the publisher for any reparation, damages, or monetary loss due to the
information herein, either directly or indirectly.
Respective authors own all copyrights not held by the publisher.
Legal Notice:
This book is copyright protected. This is only for personal use. You cannot amend,
distribute, sell, use, quote or paraphrase any part or the content within this book
without the consent of the author or copyright owner. Legal action will be pursued if
this is breached.
Disclaimer Notice:
Please note the information contained within this document is for educational and
entertainment purposes only. Every attempt has been made to provide accurate, up to
date and reliable complete information. No warranties of any kind are expressed or
implied. Readers acknowledge that the author is not engaging in the rendering of
legal, financial, medical or professional advice.
By reading this document, the reader agrees that under no circumstances are we
responsible for any losses, direct or indirect, which are incurred as a result of the use
of information contained within this document, including, but not limited to, —errors,
omissions, or inaccuracies.
Table of Contents
Chapter 1 Introduction to C#
1.1 Overview of C#
1.2 Programming features of C#
1.3 C# Environment
Components of .NET framework
Chapter 2 Program Structure in C#
2.1 Introduction to C# Program structure
Namespace declaration
Class
Class Methods
Comments
2.2 User Interface elements
Start Page
Standard Toolbar
Solution Explorer
Output window
Error List
Class View Window
Code Editor
2.3 Compiling and executing C# program
Chapter 3 Syntax, Data Types, and conversion
3.1 Different keywords in C#
1) Keywords for class, method, field and property
2) Keywords for type conversions
3) Keywords useful for program flow control
4) Keywords used for built in types and enumerations
5) Keywords used for exception handling
6) Keywords used as literals, method passing parameters
7) Keywords useful in function pointers, object allocation,
unmanaged code
3.2 Data Types in C#
3.3 Type conversion in C#
Implicit type conversion
Explicit type conversion
Chapter 4 Variables and Constants
4.1 Exploring variables in C#
4.2 Constants and literals in C#
Chapter 5 Operators in C#
5.1 Introduction to operators
5.2 Arithmetic operators
5.3 Relational operators
5.4 Logical operators
5.5 Bitwise operators
5.6 Assignment operators
5.7 Miscellaneous operators
Chapter 6 C# Decision making statements
6.1 If Statement
6.2 If else statement
6.3 Nested if statement
6.4 Switch statement
6.5 Nested switch statement
Chapter 7 Loops in C#
7.1 While loop
7.2 For loop
7.3 Do while loop
7.4 Break statement
7.5 Continue statement
Chapter 8 Classes and Methods in C#
8.1 Class declaration
C# constructors
C# destructors
8.2 Defining methods
8.3 Calling methods
8.5 Recursive method call
8.4 Passing parameters to method
Chapter 9 Arrays in C#
9.1 Introduction to arrays
9.2 Arrays declaration
9.3 Initializing and adding values
9.4 Accessing array elements
9.5 Foreach loop
9.6 Different C# arrays
Chapter 10 Strings in C#
10.1 Creation of string
10.2 Properties and methods of string class
10.3 Examples demonstrating the string functionality
Chapter 11 Encapsulation and Polymorphism
11.1 Introduction to encapsulation
11.2 Access specifier in C#
11.3 Polymorphism
11.4 Static Polymorphism
11.5 Dynamic Polymorphism
Chapter 12 Inheritance and Interfaces
12.1 Introduction to Inheritance
12.2 Base and derived classes
12.3 Base class initialization
12.4 Interfaces in C#
12.5 Multiple inheritance in C#
Chapter 13 Operator overloading and exception handling
13.1 Introduction to Operator Overloading
13.2 Different operators in overloading
13.3 Introduction to exception handling
13.4 Exception classes in C#
13.5 Exception handling
13.6 User defined exceptions
Chapter 14 Multithreading
14.1 Thread in C#
14.2 Life cycle of a thread
14.3 Main thread
14.4 Properties and methods of the Thread class
14.5 Creating and managing threads
14.6 Destroying threads
Reference links on C#
Conclusion
Chapter 1 Introduction to C#
1.1 Overview of C#
C# is an object oriented, type safe high level programming language. It has been
developed by Microsoft during the development of the .NET framework. C# was
developed for the Common Language Infrastructure (CLI), this infrastructure was
created to allow programs from various other high level languages to work together
without the need to rewrite those programs entirely. The CLI contains a various
executable programs referred simply as executables and are housed and ran in a
system called the runtime environment.
All the programs created in .Net framework execute in an environment that handles
the runtime requirements. The Common Language Runtime (CLR) provides the
virtual machine, which helps the programmers not to consider the CPU specifications.
The class library and CLR make the .NET framework.
1.2 Programming features of C#
The core component of the .NET framework is the CLR. It is an environment where
the programs are executed. The code in CLR is translated into Intermediate Language
(IL). This IL code is then used across different platforms.
The IL code is converted into machine language by the Just in Time (JIT) compiler.
The complier checks for the type safety. This ensures objects are accessed in a
compatible way.
.NET framework class library
The class library works with any .NET languages like VB.NET, VC# and
VC++.NET. The library provides classes used in the code for performing different
programming tasks like data collection, string management, file access and
connecting to the database.
CLR contains set of common rules used by all the programming languages in .NET
framework. They are known Common Language Specification (CLS). CLS helps an
object to interact with objects or applications of other languages.
Example 1:
using System;
namespace welcome
public class WelcomeUser
{
static void Main( string[] args)
{
Console.WriteLine("WelcomeUser");
Console.Read();
}
}
Namespace declaration
The namespace consists of collection of classes used in programming. The using
keyword is used for adding the System namespace. The System class consists of
classes and methods useful for the user.
Class
The class consists of data and method definitions used by the program. The class can
have one or many methods. Every class must have a Main method, which is the first
method run in the code. In the above code, WelcomeUser class is declared.
Class Methods
Methods in a class specify the behavior of the statement. In the above code,
WriteLine method is used for writing the value in the console. It is defined in the
Console class inside the System namespace.
The Read method of the Console class is used for waiting till the user hits a key.
Thus prevents the screen from closing too quickly.
Comments
Comments are text useful for providing additional information about the code. The
compiler ignores any code that is placed inside a comment block. There are two types
of comments; one comment is used for single line entries and the other for multi line
entries.
For example:
Example 2:
using System;
namespace comment
/*It is a simple code
Used for writing value to the console
*/
class Demo
{
static void Main()
{
//It is added inside Main method
Console.WriteLine("Demonstration of code");
}
}
2.2 User Interface elements
There are various user interface elements present in the Visual Studio application that
can be used in a project. We shall explore the user interface elements in detail.
Start Page
The Start Page is the initial page that gets displayed when the user opens the
Microsoft Visual Studio application.
The Visual Studio IDE provides the start page as the default home page. Through the
start page user can specify the preferences, developer communication using the .NET
platform, exploring new .NET features.
In Visual Studio .NET, the Projects tab displays the recent projects and the latest
modification date. User can use any of the existing projects from the list. Click on the
New Project button when you need to work for a new project. Click on the Open
project button when user wants to open the existing project.
Standard Toolbar
The standard toolbar is used to provide the shortcut menu commands. There are
several buttons on the toolbar that help user to perform tasks related to opening,
closing, saving, editing, pasting on the file.
There are functions related to the tools present in the standard toolbar. They are as
listed below.
New Project: A new project can be created in the application. The button
is used.
Add New Item: A new item is added to the project. The button is used
Save: All the programs created in a particular solution are saved. The
button is used
Save All: It saves all the unsaved items in an application. The button is
used
Cut: The selected objects are placed on the clipboard using this option. The
icon is used
Copy: The copy of the selected item is kept on the clipboard. The icon is
used
Paste: It is used to paste the contents in the document. The icon is used
Debugging: The compilation and execution of the project is done. The
icon is used.
Solution Explorer
In the solution explorer window, classes, project and solution name used in the
project gets displayed. Double click the file in the solution explorer for opening the
file.
Output window
The messages for the status of the features of Visual Studio .NET IDE are provided
by the output window. The current status of the application is displayed when the
user compiles it. The number of errors present during compilation is displayed in the
window. The View -> Output Window option is used to open the window.
The following figure shows the output window in Visual Studio application.
Another Random Scribd Document
with Unrelated Content
LUCY, SIR THOMAS (1532-1600), the English Warwickshire
squire who is traditionally associated with the youth of William
Shakespeare, was born on the 24th of April 1532, the son of William
Lucy, and was descended, according to Dugdale, from Thurstane de
Cherlecote, whose son Walter received the village of Charlecote from
Henry de Montfort about 1190. Walter is said to have married into
the Anglo-Norman family of Lucy, and his son adopted the mother’s
surname. Three of Sir Thomas Lucy’s ancestors had been sheriffs of
Warwickshire and Leicestershire, and on his father’s death in 1552
he inherited Sherborne and Hampton Lucy in addition to Charlecote,
which was rebuilt for him by John of Padua, known as John Thorpe,
about 1558. By his marriage with Joyce Acton he inherited Sutton
Park in Worcestershire, and became in 1586 high sheriff of the
county. He was knighted in 1565. He is said to have been under the
tutorship of John Foxe, who is supposed to have imbued his pupil
with the Puritan principles which he displayed as knight of the shire
for Warwick in the parliament of 1571 and as sheriff of the county,
but as Mrs Carmichael Stopes points out Foxe only left Oxford in
1545, and in 1547 went up to London, so that the connexion must
have been short. He often appeared at Stratford-on-Avon as justice
of the peace and as commissioner of musters for the county. As
justice of the peace he showed great zeal against the Catholics, and
took his share in the arrest of Edward Arden in 1583. In 1585 he
introduced into parliament a bill for the better preservation of game
and grain, and his reputation as a preserver of game gives some
colour to the Shakespearian tradition connected with his name.
Nicholas Rowe, writing in 1710, told a story that Lucy prosecuted
Shakespeare for deer-stealing from Charlecote Park in 1585, and
that Shakespeare aggravated the offence by writing a ballad on his
prosecutor. The trouble arising from this incident is said to have
driven Shakespeare from Stratford to London. The tale was
corroborated by Archdeacon Davies of Sapperton, Gloucestershire,
who died in 1708. The story is not necessarily falsified by the fact
that there was no deer park at Charlecote at the time, since there
was a warren, and the term warren legally covers a preserve for
other animals than hares or rabbits, roe-deer among others.
Shakespeare is generally supposed to have caricatured the local
magnate of Stratford in his portrait of Justice Shallow, who made his
first appearance in the second part of Henry IV., and a second in the
Merry Wives of Windsor. Robert Shallow is a justice of the peace in
the county of Gloucester and his ancestors have the dozen white
luces in their coats, the arms of the Lucys being three luces, while in
Dugdale’s Warwickshire (ed. 1656) there is drawn a coat-of-arms in
which these are repeated in each of the four quarters, making
twelve in all. There are many considerations which make it unlikely
that Shallow represents Lucy, the chief being the noteworthy
difference in their circumstances. Lucy died at Charlecote on the 7th
of July 1600. His grandson, Sir Thomas Lucy (1585-1640), was a
friend of Lord Herbert of Cherbury, and was eulogized by John
Davies of Hereford in 1610. The Charlecote estates eventually
passed to the Rev. John Hammond through his marriage with Alice
Lucy, and in 1789 he adopted the name of Lucy.
For a detailed account of Sir Thomas Lucy, with his son and
grandson of the same name, see Mrs C. Carmichael Stopes,
Shakespeare’s Warwickshire Contemporaries (2nd ed., 1907). Cf.
also an article by Mrs Stopes in the Fortnightly Review (Feb.
1903), entitled “Sir Thomas Lucy not the Original of Justice
Shallow,” and J. O. Halliwell-Phillipps, Observations on the
Charlecote Traditions (Brighton, 1887).
The District of Ludhiana lies south of the river Sutlej, and north of
the native states of Patiala, Jind, Nabha and Maler Kotla. Area 1455
sq. m. The district consists for the most part of a broad plain,
without hills or rivers, stretching northward from the native borders
to the ancient bed of the Sutlej. The soil is a rich clay, broken by
large patches of shifting sand. On the eastern edge, towards
Umballa, the clay is covered by a bed of rich mould, suitable for the
cultivation of cotton and sugar-cane. Towards the west the sand
occurs in union with the superficial clay, and forms a light friable soil,
on which cereals form the most profitable crop. Even here, however,
the earth is so retentive of moisture that good harvests are reaped
from fields which appear mere stretches of dry and sandy waste.
These southern uplands descend to the valley of the Sutlej by an
abrupt terrace, which marks the former bed of the river. The
principal stream has shifted to the opposite side of the valley, leaving
an alluvial strip, 10 m. in width, between its ancient and its modern
bed. The Sutlej itself is here only navigable for boats of small
burden. A branch of the Sirhind canal irrigates a large part of the
western area. The population in 1901 was 673,097. The principal
crops are wheat, millets, pulse, maize and sugar-cane. The district is
crossed by the main line of the North-Western railway from Delhi to
Lahore, with two branches.
The Upper Ludlow rocks are mainly soft mudstones and shales
with some harder sandy beds capable of being worked as
building-stones. These sandy beds are often found covered with
ripple-marks and annelid tracks; one of the uppermost sandy
layers is known as the “Fucoid bed” from the abundance of the
seaweed-like impressions it bears. At the top of this sub-group,
near Ludlow, a brown layer occurs, from a quarter of an inch to
4 in. in thickness, full of the fragmentary remains of fish
associated with those of Pterygotus and mollusca. This layer,
known as the “Ludlow Bone bed,” has been traced over a very
large area (see Bone Bed). The common fossils include plants
(Actinophyllum, Chondrites), ostracods, phyllocarids,
eurypterids, trilobites (less common than in the older groups),
numerous brachiopods (Lingula minima, Chonetes striatella),
gasteropods, pelecypods and cephalopods (Orthoceras
bullatum). Fish include Cephalaspis, Cyathaspis, Auchenaspis.
The Tilestones, Downton Castle Sandstone and Ledbury shales
are occasionally grouped together under the term Downtonian.
They are in reality passage beds between the Silurian and Old
Red Sandstone, and were originally placed in the latter system
by Sir R. I. Murchison. They are mostly grey, yellow or red
micaceous, shaly sandstones. Lingula cornea, Platyschisma
helicites and numerous phyllocarids and ostracods occur among
the fossils.
Some of the valleys of Lugo are fertile, and yield not only corn but
fruit and wine. The principal agricultural wealth, however, is on the
Miño and Sil, where rye, maize, wheat, flax, hemp and a little silk
are produced. Agriculture is in a very backward condition, mainly
owing to the extreme division of land that prevails throughout
Galicia. The exportation of cattle to Great Britain, formerly a
flourishing trade, was ruined by American and Australian
competition. Iron is found at Caurel and Incio, arsenic at
Castroverde and Cervantes, argentiferous lead at Riotorto; but,
although small quantities of iron and arsenic are exported from
Rivadéo, frequent strikes and lack of transport greatly impeded the
development of mining in the earlier years of the 20th century.
There are also quarries of granite, marble and various kinds of slate
and building-stone. The only important manufacturing industries are
those connected with leather, preserves, coarse woollen and linen
stuffs, timber and osier work. About 250 coasting vessels are
registered at the ports, and about as many boats constitute the
fishing fleet, which brings in lampreys, soles, tunny and sardines,
the last two being salted and tinned for export. The means of
communication are insufficient, though there are over 100 m. of
first-class roads, and the railways from Madrid and northern Portugal
to Corunna run through the province.
Lugo the capital (pop. 1900, 26,959) and the important towns
of Chantada (15,003), Fonsagrada (17,302), Mondoñedo
(10,590), Monforte (12,912), Panton (12,988), Villalba (13,572)
and Vivero (12,843) are described in separate articles. The
province contained in 1900 twenty-six towns of more than 7000
inhabitants, the largest being Sarria (11,998) and Saviñao
(11,182). For a general description of the people and the history
of this region see Galicia.
Lugo (Lucus Augusti) was a flourishing city under Roman rule (c.
19 b.c.-a.d. 409) and was made by Augustus the seat of a conventus
juridicus (assize). Its sulphur baths were even then well known. It
was sacked by barbarian invaders in the 5th century, and suffered
greatly in the Moorish wars of the 8th century. The bishopric dates
from a very early period, and it is said to have acquired metropolitan
rank in the middle of the 6th century; it is now in the archiepiscopal
province of Santiago de Compostela.
ebookbell.com