Docsity

Getting Started with C++ Programming using Code::Block IDE, Slides of Information Technology

Partial preview of the text

Download Getting Started with C++ Programming using Code::Block IDE and more Slides Information Technology in PDF only on Docsity!

Working With Code::Block

Install Code::Block • Download Code::Blocks^ – http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/ • Run Setup Program

Installation^1

2 3

4

Installation^5

7

Working with Code::Block • RUN Code::Block on the Start Menu

Working with C++ Project • Create new Console Application^ – File – New - Project

C++ Project^4

5

C++ Project

C++ Programming

13

Comments • Comments are nonexecutingstatements• Line comments^ // line comments • Block comments^ /* block comments*/

Print Output on Commandwindow • Function^ – cout <<– cout << “Some Text”; • Example^ int main(){^ cout <<^ "Hello world!" <<

endl;
return 0;}

15

Example #2 • Write a C++ program to print your name,Address and Age•^ Output^ Name: Budditha HettigeAddress: 12, Panadura Rd, KalutaraAge: 34

Escape Sequences •^ A character preceded by a backslash () is an^ escape sequence •^ has special meaning to the compiler Escape Sequence^

Description Insert a^ tab \t in the text at this point. Insert a^ backspace \b in the text at this point. \n^ Insert a^ newline

in the text at this point. Insert a^ carriage return \r

in the text at this point. Insert a^ formfeed \f in the text at this point. '^ Insert a^ single quote character

in the text at this point. Insert a^ double quote character "

in the text at this point. Insert a^ backslash character \

in the text at this point.

17

ASCII art with C++ •^ ASCII art is a graphic design technique that usescomputers for presentation and consists of picturespieced together from the 95 printable (from a total of128) characters defined by the ASCII Standard from

ASCII art with C++^ cout <<"^

\n”; cout <<"^

@ @ @^ \n”; cout <<"^

@ @ @ @^ \n”; cout <<"^

@ @ @^ \n”; cout <<"^

\|/^ \n”; cout <<"^

| | |^ \n”; cout <<"^

| | |^ \n”; cout <<"^

| | |^ \n”; cout <<"^

| | |^ \n”; cout <<"^

(^ )^ \n”; cout <<"^

^^^^^^ \n”;

19

C++ Data types •^ Data types supported by the C++ programminglanguage