Skip to main content

C Plus Plus programming tutorial | Basics of C++

NETWORK TECH WORLD

 C Plus Plus programming tutorial | Basics of C++

This tutorial is about C++ Programming language. I will teach C++ from very basics to advanced level in this post and upcoming posts. Just wait and read all the posts regularly.
This tutorial is mainly about theoretical knowledge but is very important!
Some Definitions :
  •  Bit : It is the smallest unit a computer can understand. it is either 0 or 1. 0 generally means circuit is OFF and 1 means ON.
  • ASCII : All characters on keyboard have a code which is known as ASCII code.
    Range A-Z  ->  65-90
    a-z  ->  97-122
  • Byte : Group of 8 bits. 1 byte means 1 character.
  • Program : It is a step by step instruction which tell what to do and how to do.
  • Object Code : A program which a machine can understand is called Object Program.\
Compiler : 
A program which converts source code[ English like step wise instruction to computer] to object code[language which a machine can understand].
IT executes the entire program at once and hence It is faster.
Interpreter :
A program which converts source code[ English like step wise instruction to computer] to object code[language which a machine can understand]. But the interpreter executes the program line by line and hence it is slower.
Constants : 
Integer Constant :
  • Consist of 0-9
  • Doesn’t includes commas or spaces.
  • Preceded by a + or – sign. + sign is assumed if there isn’t any sign.
Character constants : Any single character enclosed in single quote (‘). Ex :- ‘a’ ,  ’b’ .
Strings : Generally consist of more than one character within double quote (“).
Ex: “comp”, “abcd”.
Difference between String and Character :
Character constant takes 1 byte for storage while string constant takes 2 bytes for storage because in String  a byte is reserved for Null Byte.
Memory representation : 
Character : ‘A’    ==   |A| << stored in one memory cell
String : “A”  ==  |A|\0|  << stored in 2 memory cells with \0 as a NULL byte.
Variables in C++ : These are the tokens that are identified by identified by an identifier and change the value during execution.
Ex : int a=5;
a=a+3;
cout<<a;
Here a is a variable. The initial value of a was 5 but it was then changed to 8 by command a=a+3 .

Comments

Popular posts from this blog

What is network

NETWORK TECH WORLD What is network  A network is a group of devices, such as computers, servers, and printers, that are connected together and able to communicate with each other. Networks can be classified based on their size and scope, such as a local area network (LAN), which is a network that is confined to a small area, such as a single building or campus, or a wide area network (WAN), which is a network that spans a large geographical area, such as a city or a country. Networks can also be classified based on their communication protocols, such as the Internet, which is a global network that uses the Internet Protocol (IP) to connect devices around the world.

Ten Keyboard Shortcuts Everyone Should Know

NETWORK TECH WORLD  Ten Keyboard Shortcuts Everyone Should Know Using keyboard shortcuts is the easiest way to save you time and effort when you need to access commonly used symbols or processes. Indeed, navigating through shortcuts will keep your internet browsing fast and sharp. You can use shortcuts to inserts symbols instead of spending hours searching the internet for them and subsequently continuously copying and pasting them throughout your work. Some of the most used symbols in business are available in a three key combo. Pressing and holding Ctrl and Alt  and adding a letter to the combination will serve up the symbol. If you add C, you’ll deliver a ©. R, returns ®. T displays ™.  E shows € and the L creates a numbered list 1) 2). Lost Symbols © Ctrl Alt C ® Ctrl Alt R ™ Ctrl Alt T € Ctrl Alt E 3) Ctrl Alt L There’s a great little time saver if you’re working on many documents, across different programs at the same time. Instead of having

Boot Winxp Fast

NETWORK TECH WORLD Boot Winxp Fast Follow the following steps 1. Open notepad.exe, type "del c:\windows\prefetch\ntosboot-*.* /q" (without the quotes) & save as "ntosboot.bat" in c:\ 2. From the Start menu, select "Run..." & type "gpedit.msc". 3. Double click "Windows Settings" under "Computer Configuration" and double click again on "Shutdown" in the right window. 4. In the new window, click "add", "Browse", locate your "ntosboot.bat" file & click "Open". 5. Click "OK", "Apply" & "OK" once again to exit. 6. From the Start menu, select "Run..." & type "devmgmt.msc". 7. Double click on "IDE ATA/ATAPI controllers" 8. Right click on "Primary IDE Channel" and select "Properties". 9. Select the "Advanced Settings" tab then on the device or 1 that doesn't h